'' ------------------------------------------------------------------------------ '' '' Generated by Xsd2Code. Version 3.4.1.33667 Microsoft Reciprocal License (Ms-RL) '' MicCustExportComponentsListVisualBasicFalseFalseFalseFalseFalseFalseFalseTrueFalseFalseFalseFalseNet40SerializeDeserializeSaveToFileLoadFromFileFalseFalseFalseFalseFalseFalseDefaultUTF8FalseTrue '' '' ------------------------------------------------------------------------------ Imports System Imports System.Diagnostics Imports System.Xml.Serialization Imports System.Collections Imports System.Xml.Schema Imports System.ComponentModel Imports System.IO Imports System.Text Imports System.Collections.Generic Namespace MicCustExportComponents Partial Public Class TItem Private itemNoField As String Private itemDescField As String Private commCodeField As String Private prodGrField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property itemNo() As String Get Return Me.itemNoField End Get Set Me.itemNoField = Value End Set End Property Public Property itemDesc() As String Get Return Me.itemDescField End Get Set Me.itemDescField = Value End Set End Property Public Property commCode() As String Get Return Me.commCodeField End Get Set Me.commCodeField = Value End Set End Property Public Property prodGr() As String Get Return Me.prodGrField End Get Set Me.prodGrField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TItem)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TItem object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TItem object ''' '''string workflow markup to deserialize '''Output TItem object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TItem, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TItem) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TItem) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TItem Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TItem) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TItem object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TItem object ''' '''string xml file to load and deserialize '''Output TItem object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TItem, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TItem) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TItem) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TItem Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TAddress Private addrNoField As String Private addrNameField As List(Of String) Private addrStreetField As String Private addrLocField As String Private addrCtryField As String Private addrStateField As String Private addrZipField As String Private addrTinField As String Private addrVatIdField As String Private addrEoriField As String Private addrNatTField As String Private branchNoField As String Private addrKvbField As String Private contactPersonField As TContactPerson Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Sub New() MyBase.New Me.contactPersonField = New TContactPerson() Me.addrNameField = New List(Of String)() End Sub Public Property addrNo() As String Get Return Me.addrNoField End Get Set Me.addrNoField = Value End Set End Property Public Property addrName() As List(Of String) Get Return Me.addrNameField End Get Set Me.addrNameField = Value End Set End Property Public Property addrStreet() As String Get Return Me.addrStreetField End Get Set Me.addrStreetField = Value End Set End Property Public Property addrLoc() As String Get Return Me.addrLocField End Get Set Me.addrLocField = Value End Set End Property Public Property addrCtry() As String Get Return Me.addrCtryField End Get Set Me.addrCtryField = Value End Set End Property Public Property addrState() As String Get Return Me.addrStateField End Get Set Me.addrStateField = Value End Set End Property Public Property addrZip() As String Get Return Me.addrZipField End Get Set Me.addrZipField = Value End Set End Property Public Property addrTin() As String Get Return Me.addrTinField End Get Set Me.addrTinField = Value End Set End Property Public Property addrVatId() As String Get Return Me.addrVatIdField End Get Set Me.addrVatIdField = Value End Set End Property Public Property addrEori() As String Get Return Me.addrEoriField End Get Set Me.addrEoriField = Value End Set End Property Public Property addrNatT() As String Get Return Me.addrNatTField End Get Set Me.addrNatTField = Value End Set End Property Public Property branchNo() As String Get Return Me.branchNoField End Get Set Me.branchNoField = Value End Set End Property Public Property addrKvb() As String Get Return Me.addrKvbField End Get Set Me.addrKvbField = Value End Set End Property Public Property contactPerson() As TContactPerson Get Return Me.contactPersonField End Get Set Me.contactPersonField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddress)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TAddress object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TAddress object ''' '''string workflow markup to deserialize '''Output TAddress object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddress, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TAddress) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddress) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddress Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddress) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TAddress object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TAddress object ''' '''string xml file to load and deserialize '''Output TAddress object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAddress, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TAddress) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAddress) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TAddress Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TContactPerson Private jobField As String Private nameField As String Private emailField As String Private phoneField As String Private faxField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property job() As String Get Return Me.jobField End Get Set Me.jobField = Value End Set End Property Public Property name() As String Get Return Me.nameField End Get Set Me.nameField = Value End Set End Property Public Property email() As String Get Return Me.emailField End Get Set Me.emailField = Value End Set End Property Public Property phone() As String Get Return Me.phoneField End Get Set Me.phoneField = Value End Set End Property Public Property fax() As String Get Return Me.faxField End Get Set Me.faxField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TContactPerson)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TContactPerson object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TContactPerson object ''' '''string workflow markup to deserialize '''Output TContactPerson object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContactPerson, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TContactPerson) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContactPerson) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TContactPerson Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TContactPerson) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TContactPerson object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TContactPerson object ''' '''string xml file to load and deserialize '''Output TContactPerson object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TContactPerson, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TContactPerson) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TContactPerson) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TContactPerson Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TCustomsOffice Private codeOffField As String Private offCtryField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property codeOff() As String Get Return Me.codeOffField End Get Set Me.codeOffField = Value End Set End Property Public Property offCtry() As String Get Return Me.offCtryField End Get Set Me.offCtryField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomsOffice)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TCustomsOffice object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TCustomsOffice object ''' '''string workflow markup to deserialize '''Output TCustomsOffice object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomsOffice, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TCustomsOffice) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomsOffice) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomsOffice Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomsOffice) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TCustomsOffice object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TCustomsOffice object ''' '''string xml file to load and deserialize '''Output TCustomsOffice object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomsOffice, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TCustomsOffice) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomsOffice) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TCustomsOffice Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TMotInl Private motField As String Private natField As String Private typeField As String Private licNoField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property mot() As String Get Return Me.motField End Get Set Me.motField = Value End Set End Property Public Property nat() As String Get Return Me.natField End Get Set Me.natField = Value End Set End Property Public Property type() As String Get Return Me.typeField End Get Set Me.typeField = Value End Set End Property Public Property licNo() As String Get Return Me.licNoField End Get Set Me.licNoField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMotInl)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TMotInl object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TMotInl object ''' '''string workflow markup to deserialize '''Output TMotInl object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMotInl, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TMotInl) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMotInl) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TMotInl Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMotInl) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TMotInl object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TMotInl object ''' '''string xml file to load and deserialize '''Output TMotInl object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMotInl, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TMotInl) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMotInl) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMotInl Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TMot Private motField As String Private natField As String Private typeField As String Private licNoField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property mot() As String Get Return Me.motField End Get Set Me.motField = Value End Set End Property Public Property nat() As String Get Return Me.natField End Get Set Me.natField = Value End Set End Property Public Property type() As String Get Return Me.typeField End Get Set Me.typeField = Value End Set End Property Public Property licNo() As String Get Return Me.licNoField End Get Set Me.licNoField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMot)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TMot object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TMot object ''' '''string workflow markup to deserialize '''Output TMot object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMot, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TMot) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMot) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TMot Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMot) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TMot object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TMot object ''' '''string xml file to load and deserialize '''Output TMot object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMot, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TMot) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMot) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMot Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TFreight Private flagField As String Private amountField As Decimal Private currField As String Private noneuField As Decimal Private noneuFieldSpecified As Boolean Private eunatField As Decimal Private eunatFieldSpecified As Boolean Private natField As Decimal Private natFieldSpecified As Boolean Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property flag() As String Get Return Me.flagField End Get Set Me.flagField = Value End Set End Property Public Property amount() As Decimal Get Return Me.amountField End Get Set Me.amountField = Value End Set End Property Public Property curr() As String Get Return Me.currField End Get Set Me.currField = Value End Set End Property Public Property noneu() As Decimal Get Return Me.noneuField End Get Set Me.noneuField = Value End Set End Property Public Property noneuSpecified() As Boolean Get Return Me.noneuFieldSpecified End Get Set Me.noneuFieldSpecified = Value End Set End Property Public Property eunat() As Decimal Get Return Me.eunatField End Get Set Me.eunatField = Value End Set End Property Public Property eunatSpecified() As Boolean Get Return Me.eunatFieldSpecified End Get Set Me.eunatFieldSpecified = Value End Set End Property Public Property nat() As Decimal Get Return Me.natField End Get Set Me.natField = Value End Set End Property Public Property natSpecified() As Boolean Get Return Me.natFieldSpecified End Get Set Me.natFieldSpecified = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TFreight)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TFreight object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TFreight object ''' '''string workflow markup to deserialize '''Output TFreight object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreight, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TFreight) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreight) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TFreight Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TFreight) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TFreight object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TFreight object ''' '''string xml file to load and deserialize '''Output TFreight object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TFreight, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TFreight) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TFreight) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TFreight Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TAssurance Private flagField As String Private amountField As Decimal Private currField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property flag() As String Get Return Me.flagField End Get Set Me.flagField = Value End Set End Property Public Property amount() As Decimal Get Return Me.amountField End Get Set Me.amountField = Value End Set End Property Public Property curr() As String Get Return Me.currField End Get Set Me.currField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAssurance)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TAssurance object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TAssurance object ''' '''string workflow markup to deserialize '''Output TAssurance object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAssurance, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TAssurance) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAssurance) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TAssurance Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAssurance) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TAssurance object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TAssurance object ''' '''string xml file to load and deserialize '''Output TAssurance object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAssurance, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TAssurance) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAssurance) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TAssurance Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TAddCosts Private typeField As String Private flagField As TAddCostsFlag Private amountField As Decimal Private currField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property type() As String Get Return Me.typeField End Get Set Me.typeField = Value End Set End Property Public Property flag() As TAddCostsFlag Get Return Me.flagField End Get Set Me.flagField = Value End Set End Property Public Property amount() As Decimal Get Return Me.amountField End Get Set Me.amountField = Value End Set End Property Public Property curr() As String Get Return Me.currField End Get Set Me.currField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddCosts)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TAddCosts object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TAddCosts object ''' '''string workflow markup to deserialize '''Output TAddCosts object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCosts, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TAddCosts) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCosts) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddCosts Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddCosts) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TAddCosts object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TAddCosts object ''' '''string xml file to load and deserialize '''Output TAddCosts object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAddCosts, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TAddCosts) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAddCosts) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TAddCosts Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Public Enum TAddCostsFlag ''' P ''' V End Enum Partial Public Class TAddCostsShipment Private currField As String Private amountField As Decimal Private flagField As TAddCostsShipmentFlag Private typeField As String Private splitFlagField As AddCostsSplitType Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property curr() As String Get Return Me.currField End Get Set Me.currField = Value End Set End Property Public Property amount() As Decimal Get Return Me.amountField End Get Set Me.amountField = Value End Set End Property Public Property flag() As TAddCostsShipmentFlag Get Return Me.flagField End Get Set Me.flagField = Value End Set End Property Public Property type() As String Get Return Me.typeField End Get Set Me.typeField = Value End Set End Property Public Property splitFlag() As AddCostsSplitType Get Return Me.splitFlagField End Get Set Me.splitFlagField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddCostsShipment)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TAddCostsShipment object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TAddCostsShipment object ''' '''string workflow markup to deserialize '''Output TAddCostsShipment object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCostsShipment, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TAddCostsShipment) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCostsShipment) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddCostsShipment Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddCostsShipment) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TAddCostsShipment object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TAddCostsShipment object ''' '''string xml file to load and deserialize '''Output TAddCostsShipment object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAddCostsShipment, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TAddCostsShipment) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAddCostsShipment) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TAddCostsShipment Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Public Enum TAddCostsShipmentFlag ''' P ''' V End Enum Public Enum AddCostsSplitType ''' V ''' Q End Enum Partial Public Class TDelTerm Private codeField As String Private descField As String Private code2Field As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property code() As String Get Return Me.codeField End Get Set Me.codeField = Value End Set End Property Public Property desc() As String Get Return Me.descField End Get Set Me.descField = Value End Set End Property Public Property code2() As String Get Return Me.code2Field End Get Set Me.code2Field = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDelTerm)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TDelTerm object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TDelTerm object ''' '''string workflow markup to deserialize '''Output TDelTerm object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelTerm, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TDelTerm) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelTerm) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TDelTerm Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDelTerm) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TDelTerm object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TDelTerm object ''' '''string xml file to load and deserialize '''Output TDelTerm object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDelTerm, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TDelTerm) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDelTerm) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TDelTerm Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TDelNote Private delNoField As String Private positionField As Long Private positionFieldSpecified As Boolean Private delDateField As Date Private delDateFieldSpecified As Boolean Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property delNo() As String Get Return Me.delNoField End Get Set Me.delNoField = Value End Set End Property Public Property position() As Long Get Return Me.positionField End Get Set Me.positionField = Value End Set End Property Public Property positionSpecified() As Boolean Get Return Me.positionFieldSpecified End Get Set Me.positionFieldSpecified = Value End Set End Property Public Property delDate() As Date Get Return Me.delDateField End Get Set Me.delDateField = Value End Set End Property Public Property delDateSpecified() As Boolean Get Return Me.delDateFieldSpecified End Get Set Me.delDateFieldSpecified = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDelNote)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TDelNote object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TDelNote object ''' '''string workflow markup to deserialize '''Output TDelNote object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelNote, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TDelNote) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelNote) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TDelNote Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDelNote) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TDelNote object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TDelNote object ''' '''string xml file to load and deserialize '''Output TDelNote object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDelNote, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TDelNote) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDelNote) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TDelNote Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TOrder Private ordNoField As String Private ordDateField As Date Private ordDateFieldSpecified As Boolean Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property ordNo() As String Get Return Me.ordNoField End Get Set Me.ordNoField = Value End Set End Property Public Property ordDate() As Date Get Return Me.ordDateField End Get Set Me.ordDateField = Value End Set End Property Public Property ordDateSpecified() As Boolean Get Return Me.ordDateFieldSpecified End Get Set Me.ordDateFieldSpecified = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TOrder)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TOrder object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TOrder object ''' '''string workflow markup to deserialize '''Output TOrder object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TOrder, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TOrder) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TOrder) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TOrder Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TOrder) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TOrder object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TOrder object ''' '''string xml file to load and deserialize '''Output TOrder object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TOrder, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TOrder) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TOrder) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TOrder Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TBomNo Private noField As String Private varField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property no() As String Get Return Me.noField End Get Set Me.noField = Value End Set End Property Public Property var() As String Get Return Me.varField End Get Set Me.varField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TBomNo)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TBomNo object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TBomNo object ''' '''string workflow markup to deserialize '''Output TBomNo object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TBomNo, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TBomNo) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TBomNo) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TBomNo Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TBomNo) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TBomNo object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TBomNo object ''' '''string xml file to load and deserialize '''Output TBomNo object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TBomNo, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TBomNo) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TBomNo) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TBomNo Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TAttribute Private attribTypeField As String Private attribTextField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property attribType() As String Get Return Me.attribTypeField End Get Set Me.attribTypeField = Value End Set End Property Public Property attribText() As String Get Return Me.attribTextField End Get Set Me.attribTextField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAttribute)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TAttribute object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TAttribute object ''' '''string workflow markup to deserialize '''Output TAttribute object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttribute, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TAttribute) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttribute) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TAttribute Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAttribute) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TAttribute object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TAttribute object ''' '''string xml file to load and deserialize '''Output TAttribute object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAttribute, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TAttribute) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAttribute) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TAttribute Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TPartner Private partnerTypField As String Private partnerAddressField As TPartnerPartnerAddress Private partnerRelationField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Sub New() MyBase.New Me.partnerAddressField = New TPartnerPartnerAddress() End Sub Public Property partnerTyp() As String Get Return Me.partnerTypField End Get Set Me.partnerTypField = Value End Set End Property Public Property partnerAddress() As TPartnerPartnerAddress Get Return Me.partnerAddressField End Get Set Me.partnerAddressField = Value End Set End Property Public Property partnerRelation() As String Get Return Me.partnerRelationField End Get Set Me.partnerRelationField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPartner)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TPartner object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TPartner object ''' '''string workflow markup to deserialize '''Output TPartner object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartner, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TPartner) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartner) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TPartner Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPartner) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TPartner object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TPartner object ''' '''string xml file to load and deserialize '''Output TPartner object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPartner, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TPartner) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPartner) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TPartner Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TPartnerPartnerAddress Private addrNoField As String Private addrNoTypeField As String Private addrNameField As List(Of String) Private addrStreetField As String Private addrStreet2Field As String Private addrLocField As String Private addrCtryField As String Private addrStateField As String Private addrZipField As String Private addrTinField As String Private addrEoriField As String Private addrNatTField As String Private branchNoField As String Private addrKvbField As String Private addrInfoField As String Private contactPersonField As TContactPerson Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Sub New() MyBase.New Me.contactPersonField = New TContactPerson() Me.addrNameField = New List(Of String)() End Sub Public Property addrNo() As String Get Return Me.addrNoField End Get Set Me.addrNoField = Value End Set End Property Public Property addrNoType() As String Get Return Me.addrNoTypeField End Get Set Me.addrNoTypeField = Value End Set End Property Public Property addrName() As List(Of String) Get Return Me.addrNameField End Get Set Me.addrNameField = Value End Set End Property Public Property addrStreet() As String Get Return Me.addrStreetField End Get Set Me.addrStreetField = Value End Set End Property Public Property addrStreet2() As String Get Return Me.addrStreet2Field End Get Set Me.addrStreet2Field = Value End Set End Property Public Property addrLoc() As String Get Return Me.addrLocField End Get Set Me.addrLocField = Value End Set End Property Public Property addrCtry() As String Get Return Me.addrCtryField End Get Set Me.addrCtryField = Value End Set End Property Public Property addrState() As String Get Return Me.addrStateField End Get Set Me.addrStateField = Value End Set End Property Public Property addrZip() As String Get Return Me.addrZipField End Get Set Me.addrZipField = Value End Set End Property Public Property addrTin() As String Get Return Me.addrTinField End Get Set Me.addrTinField = Value End Set End Property Public Property addrEori() As String Get Return Me.addrEoriField End Get Set Me.addrEoriField = Value End Set End Property Public Property addrNatT() As String Get Return Me.addrNatTField End Get Set Me.addrNatTField = Value End Set End Property Public Property branchNo() As String Get Return Me.branchNoField End Get Set Me.branchNoField = Value End Set End Property Public Property addrKvb() As String Get Return Me.addrKvbField End Get Set Me.addrKvbField = Value End Set End Property Public Property addrInfo() As String Get Return Me.addrInfoField End Get Set Me.addrInfoField = Value End Set End Property Public Property contactPerson() As TContactPerson Get Return Me.contactPersonField End Get Set Me.contactPersonField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPartnerPartnerAddress)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TPartnerPartnerAddress object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TPartnerPartnerAddress object ''' '''string workflow markup to deserialize '''Output TPartnerPartnerAddress object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartnerPartnerAddress, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TPartnerPartnerAddress) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartnerPartnerAddress) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TPartnerPartnerAddress Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPartnerPartnerAddress) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TPartnerPartnerAddress object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TPartnerPartnerAddress object ''' '''string xml file to load and deserialize '''Output TPartnerPartnerAddress object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPartnerPartnerAddress, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TPartnerPartnerAddress) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPartnerPartnerAddress) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TPartnerPartnerAddress Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TDeclType Private type1Field As String Private type2Field As String Private type3Field As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property type1() As String Get Return Me.type1Field End Get Set Me.type1Field = Value End Set End Property Public Property type2() As String Get Return Me.type2Field End Get Set Me.type2Field = Value End Set End Property Public Property type3() As String Get Return Me.type3Field End Get Set Me.type3Field = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDeclType)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TDeclType object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TDeclType object ''' '''string workflow markup to deserialize '''Output TDeclType object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeclType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TDeclType) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeclType) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TDeclType Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDeclType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TDeclType object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TDeclType object ''' '''string xml file to load and deserialize '''Output TDeclType object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDeclType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TDeclType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDeclType) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TDeclType Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TLocationOfGoods Private codeField As String Private streetField As String Private zipField As String Private locField As String Private additField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property code() As String Get Return Me.codeField End Get Set Me.codeField = Value End Set End Property Public Property street() As String Get Return Me.streetField End Get Set Me.streetField = Value End Set End Property Public Property zip() As String Get Return Me.zipField End Get Set Me.zipField = Value End Set End Property Public Property loc() As String Get Return Me.locField End Get Set Me.locField = Value End Set End Property Public Property addit() As String Get Return Me.additField End Get Set Me.additField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TLocationOfGoods)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TLocationOfGoods object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TLocationOfGoods object ''' '''string workflow markup to deserialize '''Output TLocationOfGoods object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TLocationOfGoods, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TLocationOfGoods) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TLocationOfGoods) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TLocationOfGoods Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TLocationOfGoods) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TLocationOfGoods object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TLocationOfGoods object ''' '''string xml file to load and deserialize '''Output TLocationOfGoods object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TLocationOfGoods, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TLocationOfGoods) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TLocationOfGoods) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TLocationOfGoods Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TImportQuantity Private qualifierField As String Private unitField As String Private valueField As Decimal Private valueFieldSpecified As Boolean Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property qualifier() As String Get Return Me.qualifierField End Get Set Me.qualifierField = Value End Set End Property Public Property unit() As String Get Return Me.unitField End Get Set Me.unitField = Value End Set End Property Public Property value() As Decimal Get Return Me.valueField End Get Set Me.valueField = Value End Set End Property Public Property valueSpecified() As Boolean Get Return Me.valueFieldSpecified End Get Set Me.valueFieldSpecified = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TImportQuantity)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TImportQuantity object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TImportQuantity object ''' '''string workflow markup to deserialize '''Output TImportQuantity object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportQuantity, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TImportQuantity) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportQuantity) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TImportQuantity Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TImportQuantity) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TImportQuantity object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TImportQuantity object ''' '''string xml file to load and deserialize '''Output TImportQuantity object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TImportQuantity, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TImportQuantity) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TImportQuantity) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TImportQuantity Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TImportReference Private typeField As String Private authNrField As String Private impShpNrField As String Private lineNoField As String Private authRegistryNoField As String Private commCodeField As String Private usualTreatmentField As String Private importAtlasField As String Private addInfoField As String Private quantityField As TImportQuantity Private tradeQuantityField As TImportQuantity Private packageQuantityField As Decimal Private packageQuantityFieldSpecified As Boolean Private netMassField As Decimal Private netMassFieldSpecified As Boolean Private grossMassField As Decimal Private grossMassFieldSpecified As Boolean Private statisticalQuantityField As Decimal Private statisticalQuantityFieldSpecified As Boolean Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Sub New() MyBase.New Me.tradeQuantityField = New TImportQuantity() Me.quantityField = New TImportQuantity() End Sub Public Property type() As String Get Return Me.typeField End Get Set Me.typeField = Value End Set End Property Public Property authNr() As String Get Return Me.authNrField End Get Set Me.authNrField = Value End Set End Property Public Property impShpNr() As String Get Return Me.impShpNrField End Get Set Me.impShpNrField = Value End Set End Property Public Property lineNo() As String Get Return Me.lineNoField End Get Set Me.lineNoField = Value End Set End Property Public Property authRegistryNo() As String Get Return Me.authRegistryNoField End Get Set Me.authRegistryNoField = Value End Set End Property Public Property commCode() As String Get Return Me.commCodeField End Get Set Me.commCodeField = Value End Set End Property Public Property usualTreatment() As String Get Return Me.usualTreatmentField End Get Set Me.usualTreatmentField = Value End Set End Property Public Property importAtlas() As String Get Return Me.importAtlasField End Get Set Me.importAtlasField = Value End Set End Property Public Property addInfo() As String Get Return Me.addInfoField End Get Set Me.addInfoField = Value End Set End Property Public Property quantity() As TImportQuantity Get Return Me.quantityField End Get Set Me.quantityField = Value End Set End Property Public Property tradeQuantity() As TImportQuantity Get Return Me.tradeQuantityField End Get Set Me.tradeQuantityField = Value End Set End Property Public Property packageQuantity() As Decimal Get Return Me.packageQuantityField End Get Set Me.packageQuantityField = Value End Set End Property Public Property packageQuantitySpecified() As Boolean Get Return Me.packageQuantityFieldSpecified End Get Set Me.packageQuantityFieldSpecified = Value End Set End Property Public Property netMass() As Decimal Get Return Me.netMassField End Get Set Me.netMassField = Value End Set End Property Public Property netMassSpecified() As Boolean Get Return Me.netMassFieldSpecified End Get Set Me.netMassFieldSpecified = Value End Set End Property Public Property grossMass() As Decimal Get Return Me.grossMassField End Get Set Me.grossMassField = Value End Set End Property Public Property grossMassSpecified() As Boolean Get Return Me.grossMassFieldSpecified End Get Set Me.grossMassFieldSpecified = Value End Set End Property Public Property statisticalQuantity() As Decimal Get Return Me.statisticalQuantityField End Get Set Me.statisticalQuantityField = Value End Set End Property Public Property statisticalQuantitySpecified() As Boolean Get Return Me.statisticalQuantityFieldSpecified End Get Set Me.statisticalQuantityFieldSpecified = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TImportReference)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TImportReference object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TImportReference object ''' '''string workflow markup to deserialize '''Output TImportReference object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportReference, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TImportReference) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportReference) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TImportReference Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TImportReference) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TImportReference object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TImportReference object ''' '''string xml file to load and deserialize '''Output TImportReference object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TImportReference, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TImportReference) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TImportReference) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TImportReference Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TRoute Private countryField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property country() As String Get Return Me.countryField End Get Set Me.countryField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TRoute)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TRoute object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TRoute object ''' '''string workflow markup to deserialize '''Output TRoute object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRoute, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TRoute) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRoute) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TRoute Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TRoute) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TRoute object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TRoute object ''' '''string xml file to load and deserialize '''Output TRoute object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRoute, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TRoute) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRoute) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRoute Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TMotArrivalDispatch Private motField As String Private natField As String Private licNoField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property mot() As String Get Return Me.motField End Get Set Me.motField = Value End Set End Property Public Property nat() As String Get Return Me.natField End Get Set Me.natField = Value End Set End Property Public Property licNo() As String Get Return Me.licNoField End Get Set Me.licNoField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMotArrivalDispatch)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TMotArrivalDispatch object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TMotArrivalDispatch object ''' '''string workflow markup to deserialize '''Output TMotArrivalDispatch object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMotArrivalDispatch, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TMotArrivalDispatch) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMotArrivalDispatch) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TMotArrivalDispatch Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMotArrivalDispatch) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TMotArrivalDispatch object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TMotArrivalDispatch object ''' '''string xml file to load and deserialize '''Output TMotArrivalDispatch object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMotArrivalDispatch, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TMotArrivalDispatch) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMotArrivalDispatch) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TMotArrivalDispatch Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TDelTermArrival Private codeField As String Private code2Field As String Private descField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property code() As String Get Return Me.codeField End Get Set Me.codeField = Value End Set End Property Public Property code2() As String Get Return Me.code2Field End Get Set Me.code2Field = Value End Set End Property Public Property desc() As String Get Return Me.descField End Get Set Me.descField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDelTermArrival)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TDelTermArrival object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TDelTermArrival object ''' '''string workflow markup to deserialize '''Output TDelTermArrival object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelTermArrival, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TDelTermArrival) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelTermArrival) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TDelTermArrival Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDelTermArrival) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TDelTermArrival object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TDelTermArrival object ''' '''string xml file to load and deserialize '''Output TDelTermArrival object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDelTermArrival, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TDelTermArrival) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDelTermArrival) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TDelTermArrival Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TItemNdp Private partNumberField As String Private partDescriptionField As String Private prodGrField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property partNumber() As String Get Return Me.partNumberField End Get Set Me.partNumberField = Value End Set End Property Public Property partDescription() As String Get Return Me.partDescriptionField End Get Set Me.partDescriptionField = Value End Set End Property Public Property prodGr() As String Get Return Me.prodGrField End Get Set Me.prodGrField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TItemNdp)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TItemNdp object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TItemNdp object ''' '''string workflow markup to deserialize '''Output TItemNdp object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TItemNdp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TItemNdp) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TItemNdp) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TItemNdp Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TItemNdp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TItemNdp object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TItemNdp object ''' '''string xml file to load and deserialize '''Output TItemNdp object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TItemNdp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TItemNdp) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TItemNdp) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TItemNdp Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TLicenseArrival Private licenseNoField As String Private licenseDateField As Date Private licenseDateFieldSpecified As Boolean Private licenseNotRequiredField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property licenseNo() As String Get Return Me.licenseNoField End Get Set Me.licenseNoField = Value End Set End Property Public Property licenseDate() As Date Get Return Me.licenseDateField End Get Set Me.licenseDateField = Value End Set End Property Public Property licenseDateSpecified() As Boolean Get Return Me.licenseDateFieldSpecified End Get Set Me.licenseDateFieldSpecified = Value End Set End Property Public Property licenseNotRequired() As String Get Return Me.licenseNotRequiredField End Get Set Me.licenseNotRequiredField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TLicenseArrival)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TLicenseArrival object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TLicenseArrival object ''' '''string workflow markup to deserialize '''Output TLicenseArrival object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TLicenseArrival, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TLicenseArrival) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TLicenseArrival) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TLicenseArrival Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TLicenseArrival) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TLicenseArrival object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TLicenseArrival object ''' '''string xml file to load and deserialize '''Output TLicenseArrival object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TLicenseArrival, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TLicenseArrival) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TLicenseArrival) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TLicenseArrival Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TTariffCode Private hsCodeField As String Private vatCodeField As String Private exciseTaxCodeField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property hsCode() As String Get Return Me.hsCodeField End Get Set Me.hsCodeField = Value End Set End Property Public Property vatCode() As String Get Return Me.vatCodeField End Get Set Me.vatCodeField = Value End Set End Property Public Property exciseTaxCode() As String Get Return Me.exciseTaxCodeField End Get Set Me.exciseTaxCodeField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TTariffCode)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TTariffCode object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TTariffCode object ''' '''string workflow markup to deserialize '''Output TTariffCode object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TTariffCode, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TTariffCode) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TTariffCode) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TTariffCode Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TTariffCode) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TTariffCode object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TTariffCode object ''' '''string xml file to load and deserialize '''Output TTariffCode object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TTariffCode, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TTariffCode) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TTariffCode) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TTariffCode Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TDocumentArrival Private docTypeField As String Private docNoField As String Private docDateField As Date Private docDateFieldSpecified As Boolean Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property docType() As String Get Return Me.docTypeField End Get Set Me.docTypeField = Value End Set End Property Public Property docNo() As String Get Return Me.docNoField End Get Set Me.docNoField = Value End Set End Property Public Property docDate() As Date Get Return Me.docDateField End Get Set Me.docDateField = Value End Set End Property Public Property docDateSpecified() As Boolean Get Return Me.docDateFieldSpecified End Get Set Me.docDateFieldSpecified = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDocumentArrival)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TDocumentArrival object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TDocumentArrival object ''' '''string workflow markup to deserialize '''Output TDocumentArrival object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDocumentArrival, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TDocumentArrival) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDocumentArrival) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TDocumentArrival Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDocumentArrival) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TDocumentArrival object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TDocumentArrival object ''' '''string xml file to load and deserialize '''Output TDocumentArrival object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDocumentArrival, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TDocumentArrival) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDocumentArrival) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TDocumentArrival Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TPackageArrival Private packageCountField As Integer Private packageCountFieldSpecified As Boolean Private packageTypeField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property packageCount() As Integer Get Return Me.packageCountField End Get Set Me.packageCountField = Value End Set End Property Public Property packageCountSpecified() As Boolean Get Return Me.packageCountFieldSpecified End Get Set Me.packageCountFieldSpecified = Value End Set End Property Public Property packageType() As String Get Return Me.packageTypeField End Get Set Me.packageTypeField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPackageArrival)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TPackageArrival object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TPackageArrival object ''' '''string workflow markup to deserialize '''Output TPackageArrival object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageArrival, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TPackageArrival) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageArrival) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TPackageArrival Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPackageArrival) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TPackageArrival object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TPackageArrival object ''' '''string xml file to load and deserialize '''Output TPackageArrival object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPackageArrival, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TPackageArrival) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPackageArrival) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TPackageArrival Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TAdditionalCodes Private addCode1Field As String Private addCode2Field As String Private addCode3Field As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property addCode1() As String Get Return Me.addCode1Field End Get Set Me.addCode1Field = Value End Set End Property Public Property addCode2() As String Get Return Me.addCode2Field End Get Set Me.addCode2Field = Value End Set End Property Public Property addCode3() As String Get Return Me.addCode3Field End Get Set Me.addCode3Field = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAdditionalCodes)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TAdditionalCodes object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TAdditionalCodes object ''' '''string workflow markup to deserialize '''Output TAdditionalCodes object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAdditionalCodes, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TAdditionalCodes) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAdditionalCodes) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TAdditionalCodes Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAdditionalCodes) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TAdditionalCodes object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TAdditionalCodes object ''' '''string xml file to load and deserialize '''Output TAdditionalCodes object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAdditionalCodes, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TAdditionalCodes) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAdditionalCodes) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TAdditionalCodes Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TPrefDocumentArrival Private prefTypeField As String Private prefNoField As String Private prefDateField As Date Private prefDateFieldSpecified As Boolean Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property prefType() As String Get Return Me.prefTypeField End Get Set Me.prefTypeField = Value End Set End Property Public Property prefNo() As String Get Return Me.prefNoField End Get Set Me.prefNoField = Value End Set End Property Public Property prefDate() As Date Get Return Me.prefDateField End Get Set Me.prefDateField = Value End Set End Property Public Property prefDateSpecified() As Boolean Get Return Me.prefDateFieldSpecified End Get Set Me.prefDateFieldSpecified = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPrefDocumentArrival)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TPrefDocumentArrival object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TPrefDocumentArrival object ''' '''string workflow markup to deserialize '''Output TPrefDocumentArrival object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPrefDocumentArrival, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TPrefDocumentArrival) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPrefDocumentArrival) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TPrefDocumentArrival Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPrefDocumentArrival) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TPrefDocumentArrival object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TPrefDocumentArrival object ''' '''string xml file to load and deserialize '''Output TPrefDocumentArrival object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPrefDocumentArrival, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TPrefDocumentArrival) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPrefDocumentArrival) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TPrefDocumentArrival Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TOrderArrival Private ordNoField As String Private ordLineNoField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property ordNo() As String Get Return Me.ordNoField End Get Set Me.ordNoField = Value End Set End Property Public Property ordLineNo() As String Get Return Me.ordLineNoField End Get Set Me.ordLineNoField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TOrderArrival)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TOrderArrival object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TOrderArrival object ''' '''string workflow markup to deserialize '''Output TOrderArrival object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TOrderArrival, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TOrderArrival) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TOrderArrival) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TOrderArrival Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TOrderArrival) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TOrderArrival object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TOrderArrival object ''' '''string xml file to load and deserialize '''Output TOrderArrival object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TOrderArrival, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TOrderArrival) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TOrderArrival) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TOrderArrival Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TInf Private infField As String Private infDutyAmountField As Decimal Private infDutyAmountFieldSpecified As Boolean Private infDutyAmountCurrField As String Private infDutyBasisField As Decimal Private infDutyBasisFieldSpecified As Boolean Private infDutyBet1Field As Decimal Private infDutyBet1FieldSpecified As Boolean Private infInterestAmountField As Decimal Private infInterestAmountFieldSpecified As Boolean Private infInterestAmountCurrField As String Private infEndUseAmountField As Decimal Private infEndUseAmountFieldSpecified As Boolean Private infEndUseAmountCurrField As String Private infDuty1TypeField As String Private infDuty1BetField As Decimal Private infDuty1BetFieldSpecified As Boolean Private infDuty1CurrField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property inf() As String Get Return Me.infField End Get Set Me.infField = Value End Set End Property Public Property infDutyAmount() As Decimal Get Return Me.infDutyAmountField End Get Set Me.infDutyAmountField = Value End Set End Property Public Property infDutyAmountSpecified() As Boolean Get Return Me.infDutyAmountFieldSpecified End Get Set Me.infDutyAmountFieldSpecified = Value End Set End Property Public Property infDutyAmountCurr() As String Get Return Me.infDutyAmountCurrField End Get Set Me.infDutyAmountCurrField = Value End Set End Property Public Property infDutyBasis() As Decimal Get Return Me.infDutyBasisField End Get Set Me.infDutyBasisField = Value End Set End Property Public Property infDutyBasisSpecified() As Boolean Get Return Me.infDutyBasisFieldSpecified End Get Set Me.infDutyBasisFieldSpecified = Value End Set End Property Public Property infDutyBet1() As Decimal Get Return Me.infDutyBet1Field End Get Set Me.infDutyBet1Field = Value End Set End Property Public Property infDutyBet1Specified() As Boolean Get Return Me.infDutyBet1FieldSpecified End Get Set Me.infDutyBet1FieldSpecified = Value End Set End Property Public Property infInterestAmount() As Decimal Get Return Me.infInterestAmountField End Get Set Me.infInterestAmountField = Value End Set End Property Public Property infInterestAmountSpecified() As Boolean Get Return Me.infInterestAmountFieldSpecified End Get Set Me.infInterestAmountFieldSpecified = Value End Set End Property Public Property infInterestAmountCurr() As String Get Return Me.infInterestAmountCurrField End Get Set Me.infInterestAmountCurrField = Value End Set End Property Public Property infEndUseAmount() As Decimal Get Return Me.infEndUseAmountField End Get Set Me.infEndUseAmountField = Value End Set End Property Public Property infEndUseAmountSpecified() As Boolean Get Return Me.infEndUseAmountFieldSpecified End Get Set Me.infEndUseAmountFieldSpecified = Value End Set End Property Public Property infEndUseAmountCurr() As String Get Return Me.infEndUseAmountCurrField End Get Set Me.infEndUseAmountCurrField = Value End Set End Property Public Property infDuty1Type() As String Get Return Me.infDuty1TypeField End Get Set Me.infDuty1TypeField = Value End Set End Property Public Property infDuty1Bet() As Decimal Get Return Me.infDuty1BetField End Get Set Me.infDuty1BetField = Value End Set End Property Public Property infDuty1BetSpecified() As Boolean Get Return Me.infDuty1BetFieldSpecified End Get Set Me.infDuty1BetFieldSpecified = Value End Set End Property Public Property infDuty1Curr() As String Get Return Me.infDuty1CurrField End Get Set Me.infDuty1CurrField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInf)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TInf object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TInf object ''' '''string workflow markup to deserialize '''Output TInf object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInf, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TInf) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInf) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TInf Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInf) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TInf object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TInf object ''' '''string xml file to load and deserialize '''Output TInf object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TInf, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TInf) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TInf) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TInf Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TCustomerFields Private textsField As List(Of TCustomerText) Private datesField As List(Of TCustomerDate) Private flagsField As List(Of TCustomerFlag) Private numbersField As List(Of TCustomerNumber) Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Sub New() MyBase.New Me.numbersField = New List(Of TCustomerNumber)() Me.flagsField = New List(Of TCustomerFlag)() Me.datesField = New List(Of TCustomerDate)() Me.textsField = New List(Of TCustomerText)() End Sub Public Property texts() As List(Of TCustomerText) Get Return Me.textsField End Get Set Me.textsField = Value End Set End Property Public Property dates() As List(Of TCustomerDate) Get Return Me.datesField End Get Set Me.datesField = Value End Set End Property Public Property flags() As List(Of TCustomerFlag) Get Return Me.flagsField End Get Set Me.flagsField = Value End Set End Property Public Property numbers() As List(Of TCustomerNumber) Get Return Me.numbersField End Get Set Me.numbersField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerFields)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TCustomerFields object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TCustomerFields object ''' '''string workflow markup to deserialize '''Output TCustomerFields object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFields, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TCustomerFields) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFields) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerFields Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerFields) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TCustomerFields object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TCustomerFields object ''' '''string xml file to load and deserialize '''Output TCustomerFields object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerFields, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TCustomerFields) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerFields) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TCustomerFields Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TCustomerText Private keyField As Integer Private valueField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property key() As Integer Get Return Me.keyField End Get Set Me.keyField = Value End Set End Property Public Property value() As String Get Return Me.valueField End Get Set Me.valueField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerText)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TCustomerText object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TCustomerText object ''' '''string workflow markup to deserialize '''Output TCustomerText object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerText, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TCustomerText) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerText) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerText Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerText) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TCustomerText object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TCustomerText object ''' '''string xml file to load and deserialize '''Output TCustomerText object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerText, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TCustomerText) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerText) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TCustomerText Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TCustomerDate Private keyField As Integer Private valueField As Date Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property key() As Integer Get Return Me.keyField End Get Set Me.keyField = Value End Set End Property Public Property value() As Date Get Return Me.valueField End Get Set Me.valueField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerDate)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TCustomerDate object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TCustomerDate object ''' '''string workflow markup to deserialize '''Output TCustomerDate object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDate, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TCustomerDate) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDate) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerDate Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerDate) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TCustomerDate object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TCustomerDate object ''' '''string xml file to load and deserialize '''Output TCustomerDate object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerDate, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TCustomerDate) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerDate) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TCustomerDate Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TCustomerFlag Private keyField As Integer Private valueField As Boolean Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property key() As Integer Get Return Me.keyField End Get Set Me.keyField = Value End Set End Property Public Property value() As Boolean Get Return Me.valueField End Get Set Me.valueField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerFlag)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TCustomerFlag object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TCustomerFlag object ''' '''string workflow markup to deserialize '''Output TCustomerFlag object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlag, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TCustomerFlag) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlag) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerFlag Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerFlag) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TCustomerFlag object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TCustomerFlag object ''' '''string xml file to load and deserialize '''Output TCustomerFlag object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerFlag, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TCustomerFlag) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerFlag) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TCustomerFlag Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TCustomerNumber Private keyField As Integer Private valueField As Decimal Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property key() As Integer Get Return Me.keyField End Get Set Me.keyField = Value End Set End Property Public Property value() As Decimal Get Return Me.valueField End Get Set Me.valueField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerNumber)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TCustomerNumber object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TCustomerNumber object ''' '''string workflow markup to deserialize '''Output TCustomerNumber object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumber, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TCustomerNumber) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumber) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerNumber Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerNumber) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TCustomerNumber object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TCustomerNumber object ''' '''string xml file to load and deserialize '''Output TCustomerNumber object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerNumber, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TCustomerNumber) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerNumber) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TCustomerNumber Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TCustomerTexts Private textField As List(Of TCustomerText) Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Sub New() MyBase.New Me.textField = New List(Of TCustomerText)() End Sub Public Property text() As List(Of TCustomerText) Get Return Me.textField End Get Set Me.textField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerTexts)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TCustomerTexts object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TCustomerTexts object ''' '''string workflow markup to deserialize '''Output TCustomerTexts object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerTexts, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TCustomerTexts) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerTexts) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerTexts Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerTexts) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TCustomerTexts object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TCustomerTexts object ''' '''string xml file to load and deserialize '''Output TCustomerTexts object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerTexts, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TCustomerTexts) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerTexts) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TCustomerTexts Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TCustomerDates Private dateField As List(Of TCustomerDate) Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Sub New() MyBase.New Me.dateField = New List(Of TCustomerDate)() End Sub Public Property [date]() As List(Of TCustomerDate) Get Return Me.dateField End Get Set Me.dateField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerDates)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TCustomerDates object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TCustomerDates object ''' '''string workflow markup to deserialize '''Output TCustomerDates object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDates, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TCustomerDates) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDates) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerDates Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerDates) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TCustomerDates object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TCustomerDates object ''' '''string xml file to load and deserialize '''Output TCustomerDates object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerDates, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TCustomerDates) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerDates) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TCustomerDates Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TCustomerFlags Private flagField As List(Of TCustomerFlag) Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Sub New() MyBase.New Me.flagField = New List(Of TCustomerFlag)() End Sub Public Property flag() As List(Of TCustomerFlag) Get Return Me.flagField End Get Set Me.flagField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerFlags)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TCustomerFlags object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TCustomerFlags object ''' '''string workflow markup to deserialize '''Output TCustomerFlags object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlags, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TCustomerFlags) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlags) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerFlags Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerFlags) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TCustomerFlags object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TCustomerFlags object ''' '''string xml file to load and deserialize '''Output TCustomerFlags object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerFlags, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TCustomerFlags) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerFlags) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TCustomerFlags Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TCustomerNumbers Private numberField As List(Of TCustomerNumber) Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Sub New() MyBase.New Me.numberField = New List(Of TCustomerNumber)() End Sub Public Property number() As List(Of TCustomerNumber) Get Return Me.numberField End Get Set Me.numberField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerNumbers)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TCustomerNumbers object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TCustomerNumbers object ''' '''string workflow markup to deserialize '''Output TCustomerNumbers object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumbers, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TCustomerNumbers) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumbers) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerNumbers Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerNumbers) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TCustomerNumbers object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TCustomerNumbers object ''' '''string xml file to load and deserialize '''Output TCustomerNumbers object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerNumbers, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TCustomerNumbers) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerNumbers) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TCustomerNumbers Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TErpShipmentData Private erpSystemIdField As String Private clientField As String Private companyCodeField As String Private customerIdField As String Private consolidationCompanyIdField As String Private accountGroupField As String Private shippingPointField As String Private loadingPointField As String Private offshoreField As Boolean Private offshoreFieldSpecified As Boolean Private routeField As String Private salesOrganizationField As String Private distributionChannelField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property erpSystemId() As String Get Return Me.erpSystemIdField End Get Set Me.erpSystemIdField = Value End Set End Property Public Property client() As String Get Return Me.clientField End Get Set Me.clientField = Value End Set End Property Public Property companyCode() As String Get Return Me.companyCodeField End Get Set Me.companyCodeField = Value End Set End Property Public Property customerId() As String Get Return Me.customerIdField End Get Set Me.customerIdField = Value End Set End Property Public Property consolidationCompanyId() As String Get Return Me.consolidationCompanyIdField End Get Set Me.consolidationCompanyIdField = Value End Set End Property Public Property accountGroup() As String Get Return Me.accountGroupField End Get Set Me.accountGroupField = Value End Set End Property Public Property shippingPoint() As String Get Return Me.shippingPointField End Get Set Me.shippingPointField = Value End Set End Property Public Property loadingPoint() As String Get Return Me.loadingPointField End Get Set Me.loadingPointField = Value End Set End Property Public Property offshore() As Boolean Get Return Me.offshoreField End Get Set Me.offshoreField = Value End Set End Property Public Property offshoreSpecified() As Boolean Get Return Me.offshoreFieldSpecified End Get Set Me.offshoreFieldSpecified = Value End Set End Property Public Property route() As String Get Return Me.routeField End Get Set Me.routeField = Value End Set End Property Public Property salesOrganization() As String Get Return Me.salesOrganizationField End Get Set Me.salesOrganizationField = Value End Set End Property Public Property distributionChannel() As String Get Return Me.distributionChannelField End Get Set Me.distributionChannelField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErpShipmentData)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TErpShipmentData object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TErpShipmentData object ''' '''string workflow markup to deserialize '''Output TErpShipmentData object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErpShipmentData, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TErpShipmentData) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErpShipmentData) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TErpShipmentData Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErpShipmentData) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TErpShipmentData object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TErpShipmentData object ''' '''string xml file to load and deserialize '''Output TErpShipmentData object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TErpShipmentData, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TErpShipmentData) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TErpShipmentData) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TErpShipmentData Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class Partial Public Class TErpLineData Private legalRegulationField As String Private exportControlClassField As String Private embargoField As String Private licenseTypeField As String Private licenseNumberField As String Private profitCenterField As String Private vZTAField As String Private erpInvoicelinenumberField As String Private erpPartnumberField As String Private Shared sSerializer As System.Xml.Serialization.XmlSerializer Public Property legalRegulation() As String Get Return Me.legalRegulationField End Get Set Me.legalRegulationField = Value End Set End Property Public Property exportControlClass() As String Get Return Me.exportControlClassField End Get Set Me.exportControlClassField = Value End Set End Property Public Property embargo() As String Get Return Me.embargoField End Get Set Me.embargoField = Value End Set End Property Public Property licenseType() As String Get Return Me.licenseTypeField End Get Set Me.licenseTypeField = Value End Set End Property Public Property licenseNumber() As String Get Return Me.licenseNumberField End Get Set Me.licenseNumberField = Value End Set End Property Public Property profitCenter() As String Get Return Me.profitCenterField End Get Set Me.profitCenterField = Value End Set End Property Public Property vZTA() As String Get Return Me.vZTAField End Get Set Me.vZTAField = Value End Set End Property Public Property erpInvoicelinenumber() As String Get Return Me.erpInvoicelinenumberField End Get Set Me.erpInvoicelinenumberField = Value End Set End Property Public Property erpPartnumber() As String Get Return Me.erpPartnumberField End Get Set Me.erpPartnumberField = Value End Set End Property Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErpLineData)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' '''Serializes current TErpLineData object into an XML document ''' '''string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Serializer.Serialize(memoryStream, Me) memoryStream.Seek(0, System.IO.SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' '''Deserializes workflow markup into an TErpLineData object ''' '''string workflow markup to deserialize '''Output TErpLineData object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErpLineData, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TErpLineData) Try obj = Deserialize(xml) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErpLineData) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(xml, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal xml As String) As TErpLineData Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(xml) Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErpLineData) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function ''' '''Serializes current TErpLineData object into file ''' '''full path of outupt xml file '''output Exception value if failed '''true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' '''Deserializes xml markup from file into an TErpLineData object ''' '''string xml file to load and deserialize '''Output TErpLineData object '''output Exception value if deserialize failed '''true if this XmlSerializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TErpLineData, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TErpLineData) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TErpLineData) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TErpLineData Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function #End Region End Class End Namespace