'' ------------------------------------------------------------------------------ '' '' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com '' {"TargetFramework":"Net48","NameSpace":"ENS_CC315A","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{"IgnoreEmptyNullable":true,"IgnoreEmptyString":true,"IgnoreEmptyCollection":true,"IgnoreEmptyComplexType":true,"IgnoreEmptySimpleType":true,"IgnoreEmptyEnumType":true},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{"Formating":true,"NewLineOnAttributes":true,"OmitXmlDeclaration":true},"JsonOutput":{},"Enabled":true,"EnableEncoding":true},"Miscellaneous":{},"InitializeFields":"AllExceptOptional"} '' '' ------------------------------------------------------------------------------ #Disable Warning Imports System Imports System.Diagnostics Imports System.Xml.Serialization Imports System.Runtime.Serialization Imports System.Collections Imports System.Xml.Schema Imports System.ComponentModel Imports System.Xml Imports System.IO Imports System.Text Imports System.Collections.Generic Namespace ENS_CC315A Partial Public Class CC315AType #Region "Private fields" Private _shouldSerializeMesTypMES20 As Boolean Private _mesSenMES3 As String Private _mesRecMES6 As String Private _datOfPreMES9 As String Private _timOfPreMES10 As String Private _priMES15 As String Private _mesIdeMES19 As String Private _mesTypMES20 As MessageTypes Private _corIdeMES25 As String Private _hEAHEA As HEAHEAType Private _tRACONCO1 As TRACONCO1Type Private _tRACONCE1 As TRACONCE1Type Private _nOTPAR670 As NOTPAR670Type Private _gOOITEGDS As List(Of GOOITEGDSType) Private _iTI As List(Of ITIType) Private _cUSOFFLON As CUSOFFLONType Private _tRAREP As TRAREPType Private _pERLODSUMDEC As PERLODSUMDECType Private _sEAID529 As List(Of SEAID529Type) Private _cUSOFFFENT730 As CUSOFFFENT730Type Private _cUSOFFSENT740 As List(Of CUSOFFSENT740Type) Private _tRACARENT601 As TRACARENT601Type Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._cUSOFFFENT730 = New CUSOFFFENT730Type() Me._pERLODSUMDEC = New PERLODSUMDECType() Me._gOOITEGDS = New List(Of GOOITEGDSType)() Me._hEAHEA = New HEAHEAType() End Sub Public Property MesSenMES3() As String Get Return Me._mesSenMES3 End Get Set Me._mesSenMES3 = Value End Set End Property Public Property MesRecMES6() As String Get Return Me._mesRecMES6 End Get Set Me._mesRecMES6 = Value End Set End Property Public Property DatOfPreMES9() As String Get Return Me._datOfPreMES9 End Get Set Me._datOfPreMES9 = Value End Set End Property Public Property TimOfPreMES10() As String Get Return Me._timOfPreMES10 End Get Set Me._timOfPreMES10 = Value End Set End Property Public Property PriMES15() As String Get Return Me._priMES15 End Get Set Me._priMES15 = Value End Set End Property Public Property MesIdeMES19() As String Get Return Me._mesIdeMES19 End Get Set Me._mesIdeMES19 = Value End Set End Property Public Property MesTypMES20() As MessageTypes Get Return Me._mesTypMES20 End Get Set Me._mesTypMES20 = Value _shouldSerializeMesTypMES20 = True End Set End Property Public Property CorIdeMES25() As String Get Return Me._corIdeMES25 End Get Set Me._corIdeMES25 = Value End Set End Property Public Property HEAHEA() As HEAHEAType Get Return Me._hEAHEA End Get Set Me._hEAHEA = Value End Set End Property Public Property TRACONCO1() As TRACONCO1Type Get Return Me._tRACONCO1 End Get Set Me._tRACONCO1 = Value End Set End Property Public Property TRACONCE1() As TRACONCE1Type Get Return Me._tRACONCE1 End Get Set Me._tRACONCE1 = Value End Set End Property Public Property NOTPAR670() As NOTPAR670Type Get Return Me._nOTPAR670 End Get Set Me._nOTPAR670 = Value End Set End Property Public Property GOOITEGDS() As List(Of GOOITEGDSType) Get Return Me._gOOITEGDS End Get Set Me._gOOITEGDS = Value End Set End Property Public Property ITI() As List(Of ITIType) Get Return Me._iTI End Get Set Me._iTI = Value End Set End Property Public Property CUSOFFLON() As CUSOFFLONType Get Return Me._cUSOFFLON End Get Set Me._cUSOFFLON = Value End Set End Property Public Property TRAREP() As TRAREPType Get Return Me._tRAREP End Get Set Me._tRAREP = Value End Set End Property Public Property PERLODSUMDEC() As PERLODSUMDECType Get Return Me._pERLODSUMDEC End Get Set Me._pERLODSUMDEC = Value End Set End Property Public Property SEAID529() As List(Of SEAID529Type) Get Return Me._sEAID529 End Get Set Me._sEAID529 = Value End Set End Property Public Property CUSOFFFENT730() As CUSOFFFENT730Type Get Return Me._cUSOFFFENT730 End Get Set Me._cUSOFFFENT730 = Value End Set End Property Public Property CUSOFFSENT740() As List(Of CUSOFFSENT740Type) Get Return Me._cUSOFFSENT740 End Get Set Me._cUSOFFSENT740 = Value End Set End Property Public Property TRACARENT601() As TRACARENT601Type Get Return Me._tRACARENT601 End Get Set Me._tRACARENT601 = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CC315AType)) End If Return _serializerXml End Get End Property ''' ''' Test whether GOOITEGDS should be serialized ''' Public Overridable Function ShouldSerializeGOOITEGDS() As Boolean Return GOOITEGDS IsNot Nothing AndAlso GOOITEGDS.Count > 0 End Function ''' ''' Test whether ITI should be serialized ''' Public Overridable Function ShouldSerializeITI() As Boolean Return ITI IsNot Nothing AndAlso ITI.Count > 0 End Function ''' ''' Test whether SEAID529 should be serialized ''' Public Overridable Function ShouldSerializeSEAID529() As Boolean Return SEAID529 IsNot Nothing AndAlso SEAID529.Count > 0 End Function ''' ''' Test whether CUSOFFSENT740 should be serialized ''' Public Overridable Function ShouldSerializeCUSOFFSENT740() As Boolean Return CUSOFFSENT740 IsNot Nothing AndAlso CUSOFFSENT740.Count > 0 End Function ''' ''' Test whether MesTypMES20 should be serialized ''' Public Overridable Function ShouldSerializeMesTypMES20() As Boolean If _shouldSerializeMesTypMES20 Then Return True End If Return (_mesTypMES20 <> CType(Nothing, MessageTypes)) End Function ''' ''' Test whether HEAHEA should be serialized ''' Public Overridable Function ShouldSerializeHEAHEA() As Boolean Return (Equals(_hEAHEA, Nothing) <> True) End Function ''' ''' Test whether TRACONCO1 should be serialized ''' Public Overridable Function ShouldSerializeTRACONCO1() As Boolean Return (Equals(_tRACONCO1, Nothing) <> True) End Function ''' ''' Test whether TRACONCE1 should be serialized ''' Public Overridable Function ShouldSerializeTRACONCE1() As Boolean Return (Equals(_tRACONCE1, Nothing) <> True) End Function ''' ''' Test whether NOTPAR670 should be serialized ''' Public Overridable Function ShouldSerializeNOTPAR670() As Boolean Return (Equals(_nOTPAR670, Nothing) <> True) End Function ''' ''' Test whether CUSOFFLON should be serialized ''' Public Overridable Function ShouldSerializeCUSOFFLON() As Boolean Return (Equals(_cUSOFFLON, Nothing) <> True) End Function ''' ''' Test whether TRAREP should be serialized ''' Public Overridable Function ShouldSerializeTRAREP() As Boolean Return (Equals(_tRAREP, Nothing) <> True) End Function ''' ''' Test whether PERLODSUMDEC should be serialized ''' Public Overridable Function ShouldSerializePERLODSUMDEC() As Boolean Return (Equals(_pERLODSUMDEC, Nothing) <> True) End Function ''' ''' Test whether CUSOFFFENT730 should be serialized ''' Public Overridable Function ShouldSerializeCUSOFFFENT730() As Boolean Return (Equals(_cUSOFFFENT730, Nothing) <> True) End Function ''' ''' Test whether TRACARENT601 should be serialized ''' Public Overridable Function ShouldSerializeTRACARENT601() As Boolean Return (Equals(_tRACARENT601, Nothing) <> True) End Function ''' ''' Test whether MesSenMES3 should be serialized ''' Public Overridable Function ShouldSerializeMesSenMES3() As Boolean Return Not String.IsNullOrEmpty(MesSenMES3) End Function ''' ''' Test whether MesRecMES6 should be serialized ''' Public Overridable Function ShouldSerializeMesRecMES6() As Boolean Return Not String.IsNullOrEmpty(MesRecMES6) End Function ''' ''' Test whether DatOfPreMES9 should be serialized ''' Public Overridable Function ShouldSerializeDatOfPreMES9() As Boolean Return Not String.IsNullOrEmpty(DatOfPreMES9) End Function ''' ''' Test whether TimOfPreMES10 should be serialized ''' Public Overridable Function ShouldSerializeTimOfPreMES10() As Boolean Return Not String.IsNullOrEmpty(TimOfPreMES10) End Function ''' ''' Test whether PriMES15 should be serialized ''' Public Overridable Function ShouldSerializePriMES15() As Boolean Return Not String.IsNullOrEmpty(PriMES15) End Function ''' ''' Test whether MesIdeMES19 should be serialized ''' Public Overridable Function ShouldSerializeMesIdeMES19() As Boolean Return Not String.IsNullOrEmpty(MesIdeMES19) End Function ''' ''' Test whether CorIdeMES25 should be serialized ''' Public Overridable Function ShouldSerializeCorIdeMES25() As Boolean Return Not String.IsNullOrEmpty(CorIdeMES25) End Function #Region "Serialize/Deserialize" ''' ''' Serialize CC315AType object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " ' Optional: Entfernen Sie NewLineOnAttributes, wenn es zu ungewollter Formatierung führt. xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) ' Erstelle ein Namespace-Objekt mit dem gewünschten Präfix – es wird nur im Root-Element deklariert. Dim ns As New XmlSerializerNamespaces() ns.Add("ie", "http://ics.dgtaxud.ec/CC315A") ' Übergib das ns-Objekt beim Serialisieren SerializerXml.Serialize(xmlWriter, Me, ns) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes CC315AType object ''' ''' string to deserialize ''' Output CC315AType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CC315AType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CC315AType) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CC315AType) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As CC315AType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CC315AType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As CC315AType Return CType(SerializerXml.Deserialize(s), CC315AType) End Function #End Region ''' ''' Serializes current CC315AType 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an CC315AType object ''' ''' File to load and deserialize ''' Output CC315AType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As CC315AType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CC315AType) Try obj = LoadFromFile(fileName, encoding) 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 CC315AType, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CC315AType) 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 CC315AType Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As CC315AType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Public Enum MessageTypes CC304A CC305A CC313A CC315A CC316A CC323A CC324A CC325A CC328A CC351A CD030C CD031C CD032C CD070B CD071B CD301A CD302A CD303A CD319A CD411C CD412C CD906B CD912B CD913B CD914B CD916B CD917B CD931C CD932C CD971B End Enum Partial Public Class HEAHEAType #Region "Private fields" Private _shouldSerializeTotGroMasHEA307 As Boolean Private _refNumHEA4 As String Private _traModAtBorHEA76 As String Private _ideOfMeaOfTraCroHEA85 As String Private _ideOfMeaOfTraCroHEA85LNG As String Private _natOfMeaOfTraCroHEA87 As String Private _totNumOfIteHEA305 As String Private _totNumOfPacHEA306 As String Private _totGroMasHEA307 As Decimal Private _decPlaHEA394 As String Private _decPlaHEA394LNG As String Private _speCirIndHEA1 As String Private _traChaMetOfPayHEA1 As String Private _comRefNumHEA As String Private _conRefNumHEA As String Private _plaLoaGOOITE334 As String Private _plaLoaGOOITE334LNG As String Private _plaUnlGOOITE334 As String Private _codPlUnHEA357LNG As String Private _decDatTimHEA114 As String Private Shared _serializerXml As XmlSerializer #End Region Public Property RefNumHEA4() As String Get Return Me._refNumHEA4 End Get Set Me._refNumHEA4 = Value End Set End Property Public Property TraModAtBorHEA76() As String Get Return Me._traModAtBorHEA76 End Get Set Me._traModAtBorHEA76 = Value End Set End Property Public Property IdeOfMeaOfTraCroHEA85() As String Get Return Me._ideOfMeaOfTraCroHEA85 End Get Set Me._ideOfMeaOfTraCroHEA85 = Value End Set End Property Public Property IdeOfMeaOfTraCroHEA85LNG() As String Get Return Me._ideOfMeaOfTraCroHEA85LNG End Get Set Me._ideOfMeaOfTraCroHEA85LNG = Value End Set End Property Public Property NatOfMeaOfTraCroHEA87() As String Get Return Me._natOfMeaOfTraCroHEA87 End Get Set Me._natOfMeaOfTraCroHEA87 = Value End Set End Property Public Property TotNumOfIteHEA305() As String Get Return Me._totNumOfIteHEA305 End Get Set Me._totNumOfIteHEA305 = Value End Set End Property Public Property TotNumOfPacHEA306() As String Get Return Me._totNumOfPacHEA306 End Get Set Me._totNumOfPacHEA306 = Value End Set End Property Public Property TotGroMasHEA307() As Decimal Get Return Me._totGroMasHEA307 End Get Set Me._totGroMasHEA307 = Value _shouldSerializeTotGroMasHEA307 = True End Set End Property Public Property DecPlaHEA394() As String Get Return Me._decPlaHEA394 End Get Set Me._decPlaHEA394 = Value End Set End Property Public Property DecPlaHEA394LNG() As String Get Return Me._decPlaHEA394LNG End Get Set Me._decPlaHEA394LNG = Value End Set End Property Public Property SpeCirIndHEA1() As String Get Return Me._speCirIndHEA1 End Get Set Me._speCirIndHEA1 = Value End Set End Property Public Property TraChaMetOfPayHEA1() As String Get Return Me._traChaMetOfPayHEA1 End Get Set Me._traChaMetOfPayHEA1 = Value End Set End Property Public Property ComRefNumHEA() As String Get Return Me._comRefNumHEA End Get Set Me._comRefNumHEA = Value End Set End Property Public Property ConRefNumHEA() As String Get Return Me._conRefNumHEA End Get Set Me._conRefNumHEA = Value End Set End Property Public Property PlaLoaGOOITE334() As String Get Return Me._plaLoaGOOITE334 End Get Set Me._plaLoaGOOITE334 = Value End Set End Property Public Property PlaLoaGOOITE334LNG() As String Get Return Me._plaLoaGOOITE334LNG End Get Set Me._plaLoaGOOITE334LNG = Value End Set End Property Public Property PlaUnlGOOITE334() As String Get Return Me._plaUnlGOOITE334 End Get Set Me._plaUnlGOOITE334 = Value End Set End Property Public Property CodPlUnHEA357LNG() As String Get Return Me._codPlUnHEA357LNG End Get Set Me._codPlUnHEA357LNG = Value End Set End Property Public Property DecDatTimHEA114() As String Get Return Me._decDatTimHEA114 End Get Set Me._decDatTimHEA114 = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(HEAHEAType)) End If Return _serializerXml End Get End Property ''' ''' Test whether TotGroMasHEA307 should be serialized ''' Public Overridable Function ShouldSerializeTotGroMasHEA307() As Boolean Return (Equals(_totGroMasHEA307, Nothing) <> True) End Function ''' ''' Test whether RefNumHEA4 should be serialized ''' Public Overridable Function ShouldSerializeRefNumHEA4() As Boolean Return Not String.IsNullOrEmpty(RefNumHEA4) End Function ''' ''' Test whether TraModAtBorHEA76 should be serialized ''' Public Overridable Function ShouldSerializeTraModAtBorHEA76() As Boolean Return Not String.IsNullOrEmpty(TraModAtBorHEA76) End Function ''' ''' Test whether IdeOfMeaOfTraCroHEA85 should be serialized ''' Public Overridable Function ShouldSerializeIdeOfMeaOfTraCroHEA85() As Boolean Return Not String.IsNullOrEmpty(IdeOfMeaOfTraCroHEA85) End Function ''' ''' Test whether IdeOfMeaOfTraCroHEA85LNG should be serialized ''' Public Overridable Function ShouldSerializeIdeOfMeaOfTraCroHEA85LNG() As Boolean Return Not String.IsNullOrEmpty(IdeOfMeaOfTraCroHEA85LNG) End Function ''' ''' Test whether NatOfMeaOfTraCroHEA87 should be serialized ''' Public Overridable Function ShouldSerializeNatOfMeaOfTraCroHEA87() As Boolean Return Not String.IsNullOrEmpty(NatOfMeaOfTraCroHEA87) End Function ''' ''' Test whether TotNumOfIteHEA305 should be serialized ''' Public Overridable Function ShouldSerializeTotNumOfIteHEA305() As Boolean Return Not String.IsNullOrEmpty(TotNumOfIteHEA305) End Function ''' ''' Test whether TotNumOfPacHEA306 should be serialized ''' Public Overridable Function ShouldSerializeTotNumOfPacHEA306() As Boolean Return Not String.IsNullOrEmpty(TotNumOfPacHEA306) End Function ''' ''' Test whether DecPlaHEA394 should be serialized ''' Public Overridable Function ShouldSerializeDecPlaHEA394() As Boolean Return Not String.IsNullOrEmpty(DecPlaHEA394) End Function ''' ''' Test whether DecPlaHEA394LNG should be serialized ''' Public Overridable Function ShouldSerializeDecPlaHEA394LNG() As Boolean Return Not String.IsNullOrEmpty(DecPlaHEA394LNG) End Function ''' ''' Test whether SpeCirIndHEA1 should be serialized ''' Public Overridable Function ShouldSerializeSpeCirIndHEA1() As Boolean Return Not String.IsNullOrEmpty(SpeCirIndHEA1) End Function ''' ''' Test whether TraChaMetOfPayHEA1 should be serialized ''' Public Overridable Function ShouldSerializeTraChaMetOfPayHEA1() As Boolean Return Not String.IsNullOrEmpty(TraChaMetOfPayHEA1) End Function ''' ''' Test whether ComRefNumHEA should be serialized ''' Public Overridable Function ShouldSerializeComRefNumHEA() As Boolean Return Not String.IsNullOrEmpty(ComRefNumHEA) End Function ''' ''' Test whether ConRefNumHEA should be serialized ''' Public Overridable Function ShouldSerializeConRefNumHEA() As Boolean Return Not String.IsNullOrEmpty(ConRefNumHEA) End Function ''' ''' Test whether PlaLoaGOOITE334 should be serialized ''' Public Overridable Function ShouldSerializePlaLoaGOOITE334() As Boolean Return Not String.IsNullOrEmpty(PlaLoaGOOITE334) End Function ''' ''' Test whether PlaLoaGOOITE334LNG should be serialized ''' Public Overridable Function ShouldSerializePlaLoaGOOITE334LNG() As Boolean Return Not String.IsNullOrEmpty(PlaLoaGOOITE334LNG) End Function ''' ''' Test whether PlaUnlGOOITE334 should be serialized ''' Public Overridable Function ShouldSerializePlaUnlGOOITE334() As Boolean Return Not String.IsNullOrEmpty(PlaUnlGOOITE334) End Function ''' ''' Test whether CodPlUnHEA357LNG should be serialized ''' Public Overridable Function ShouldSerializeCodPlUnHEA357LNG() As Boolean Return Not String.IsNullOrEmpty(CodPlUnHEA357LNG) End Function ''' ''' Test whether DecDatTimHEA114 should be serialized ''' Public Overridable Function ShouldSerializeDecDatTimHEA114() As Boolean Return Not String.IsNullOrEmpty(DecDatTimHEA114) End Function #Region "Serialize/Deserialize" ''' ''' Serialize HEAHEAType object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes HEAHEAType object ''' ''' string to deserialize ''' Output HEAHEAType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As HEAHEAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, HEAHEAType) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As HEAHEAType) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As HEAHEAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HEAHEAType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As HEAHEAType Return CType(SerializerXml.Deserialize(s), HEAHEAType) End Function #End Region ''' ''' Serializes current HEAHEAType 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an HEAHEAType object ''' ''' File to load and deserialize ''' Output HEAHEAType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As HEAHEAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, HEAHEAType) Try obj = LoadFromFile(fileName, encoding) 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 HEAHEAType, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As HEAHEAType) 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 HEAHEAType Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As HEAHEAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class TRACARENT601Type #Region "Private fields" Private _namTRACARENT604 As String Private _strNumTRACARENT607 As String Private _pstCodTRACARENT606 As String Private _ctyTRACARENT603 As String Private _couCodTRACARENT605 As String Private _tRACARENT601LNG As String Private _tINTRACARENT602 As String Private Shared _serializerXml As XmlSerializer #End Region Public Property NamTRACARENT604() As String Get Return Me._namTRACARENT604 End Get Set Me._namTRACARENT604 = Value End Set End Property Public Property StrNumTRACARENT607() As String Get Return Me._strNumTRACARENT607 End Get Set Me._strNumTRACARENT607 = Value End Set End Property Public Property PstCodTRACARENT606() As String Get Return Me._pstCodTRACARENT606 End Get Set Me._pstCodTRACARENT606 = Value End Set End Property Public Property CtyTRACARENT603() As String Get Return Me._ctyTRACARENT603 End Get Set Me._ctyTRACARENT603 = Value End Set End Property Public Property CouCodTRACARENT605() As String Get Return Me._couCodTRACARENT605 End Get Set Me._couCodTRACARENT605 = Value End Set End Property Public Property TRACARENT601LNG() As String Get Return Me._tRACARENT601LNG End Get Set Me._tRACARENT601LNG = Value End Set End Property Public Property TINTRACARENT602() As String Get Return Me._tINTRACARENT602 End Get Set Me._tINTRACARENT602 = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRACARENT601Type)) End If Return _serializerXml End Get End Property ''' ''' Test whether NamTRACARENT604 should be serialized ''' Public Overridable Function ShouldSerializeNamTRACARENT604() As Boolean Return Not String.IsNullOrEmpty(NamTRACARENT604) End Function ''' ''' Test whether StrNumTRACARENT607 should be serialized ''' Public Overridable Function ShouldSerializeStrNumTRACARENT607() As Boolean Return Not String.IsNullOrEmpty(StrNumTRACARENT607) End Function ''' ''' Test whether PstCodTRACARENT606 should be serialized ''' Public Overridable Function ShouldSerializePstCodTRACARENT606() As Boolean Return Not String.IsNullOrEmpty(PstCodTRACARENT606) End Function ''' ''' Test whether CtyTRACARENT603 should be serialized ''' Public Overridable Function ShouldSerializeCtyTRACARENT603() As Boolean Return Not String.IsNullOrEmpty(CtyTRACARENT603) End Function ''' ''' Test whether CouCodTRACARENT605 should be serialized ''' Public Overridable Function ShouldSerializeCouCodTRACARENT605() As Boolean Return Not String.IsNullOrEmpty(CouCodTRACARENT605) End Function ''' ''' Test whether TRACARENT601LNG should be serialized ''' Public Overridable Function ShouldSerializeTRACARENT601LNG() As Boolean Return Not String.IsNullOrEmpty(TRACARENT601LNG) End Function ''' ''' Test whether TINTRACARENT602 should be serialized ''' Public Overridable Function ShouldSerializeTINTRACARENT602() As Boolean Return Not String.IsNullOrEmpty(TINTRACARENT602) End Function #Region "Serialize/Deserialize" ''' ''' Serialize TRACARENT601Type object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes TRACARENT601Type object ''' ''' string to deserialize ''' Output TRACARENT601Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACARENT601Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TRACARENT601Type) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACARENT601Type) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As TRACARENT601Type Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRACARENT601Type) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRACARENT601Type Return CType(SerializerXml.Deserialize(s), TRACARENT601Type) End Function #End Region ''' ''' Serializes current TRACARENT601Type 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an TRACARENT601Type object ''' ''' File to load and deserialize ''' Output TRACARENT601Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As TRACARENT601Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TRACARENT601Type) Try obj = LoadFromFile(fileName, encoding) 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 TRACARENT601Type, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACARENT601Type) 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 TRACARENT601Type Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As TRACARENT601Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class CUSOFFSENT740Type #Region "Private fields" Private _refNumSUBENR909 As String Private Shared _serializerXml As XmlSerializer #End Region Public Property RefNumSUBENR909() As String Get Return Me._refNumSUBENR909 End Get Set Me._refNumSUBENR909 = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CUSOFFSENT740Type)) End If Return _serializerXml End Get End Property ''' ''' Test whether RefNumSUBENR909 should be serialized ''' Public Overridable Function ShouldSerializeRefNumSUBENR909() As Boolean Return Not String.IsNullOrEmpty(RefNumSUBENR909) End Function #Region "Serialize/Deserialize" ''' ''' Serialize CUSOFFSENT740Type object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes CUSOFFSENT740Type object ''' ''' string to deserialize ''' Output CUSOFFSENT740Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFSENT740Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CUSOFFSENT740Type) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFSENT740Type) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As CUSOFFSENT740Type Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CUSOFFSENT740Type) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As CUSOFFSENT740Type Return CType(SerializerXml.Deserialize(s), CUSOFFSENT740Type) End Function #End Region ''' ''' Serializes current CUSOFFSENT740Type 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an CUSOFFSENT740Type object ''' ''' File to load and deserialize ''' Output CUSOFFSENT740Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As CUSOFFSENT740Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CUSOFFSENT740Type) Try obj = LoadFromFile(fileName, encoding) 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 CUSOFFSENT740Type, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFSENT740Type) 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 CUSOFFSENT740Type Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As CUSOFFSENT740Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class CUSOFFFENT730Type #Region "Private fields" Private _refNumCUSOFFFENT731 As String Private _expDatOfArrFIRENT733 As String Private Shared _serializerXml As XmlSerializer #End Region Public Property RefNumCUSOFFFENT731() As String Get Return Me._refNumCUSOFFFENT731 End Get Set Me._refNumCUSOFFFENT731 = Value End Set End Property Public Property ExpDatOfArrFIRENT733() As String Get Return Me._expDatOfArrFIRENT733 End Get Set Me._expDatOfArrFIRENT733 = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CUSOFFFENT730Type)) End If Return _serializerXml End Get End Property ''' ''' Test whether RefNumCUSOFFFENT731 should be serialized ''' Public Overridable Function ShouldSerializeRefNumCUSOFFFENT731() As Boolean Return Not String.IsNullOrEmpty(RefNumCUSOFFFENT731) End Function ''' ''' Test whether ExpDatOfArrFIRENT733 should be serialized ''' Public Overridable Function ShouldSerializeExpDatOfArrFIRENT733() As Boolean Return Not String.IsNullOrEmpty(ExpDatOfArrFIRENT733) End Function #Region "Serialize/Deserialize" ''' ''' Serialize CUSOFFFENT730Type object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes CUSOFFFENT730Type object ''' ''' string to deserialize ''' Output CUSOFFFENT730Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFFENT730Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CUSOFFFENT730Type) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFFENT730Type) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As CUSOFFFENT730Type Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CUSOFFFENT730Type) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As CUSOFFFENT730Type Return CType(SerializerXml.Deserialize(s), CUSOFFFENT730Type) End Function #End Region ''' ''' Serializes current CUSOFFFENT730Type 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an CUSOFFFENT730Type object ''' ''' File to load and deserialize ''' Output CUSOFFFENT730Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As CUSOFFFENT730Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CUSOFFFENT730Type) Try obj = LoadFromFile(fileName, encoding) 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 CUSOFFFENT730Type, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFFENT730Type) 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 CUSOFFFENT730Type Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As CUSOFFFENT730Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class SEAID529Type #Region "Private fields" Private _seaIdSEAID530 As String Private _seaIdSEAID530LNG As String Private Shared _serializerXml As XmlSerializer #End Region Public Property SeaIdSEAID530() As String Get Return Me._seaIdSEAID530 End Get Set Me._seaIdSEAID530 = Value End Set End Property Public Property SeaIdSEAID530LNG() As String Get Return Me._seaIdSEAID530LNG End Get Set Me._seaIdSEAID530LNG = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SEAID529Type)) End If Return _serializerXml End Get End Property ''' ''' Test whether SeaIdSEAID530 should be serialized ''' Public Overridable Function ShouldSerializeSeaIdSEAID530() As Boolean Return Not String.IsNullOrEmpty(SeaIdSEAID530) End Function ''' ''' Test whether SeaIdSEAID530LNG should be serialized ''' Public Overridable Function ShouldSerializeSeaIdSEAID530LNG() As Boolean Return Not String.IsNullOrEmpty(SeaIdSEAID530LNG) End Function #Region "Serialize/Deserialize" ''' ''' Serialize SEAID529Type object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes SEAID529Type object ''' ''' string to deserialize ''' Output SEAID529Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As SEAID529Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SEAID529Type) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As SEAID529Type) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As SEAID529Type Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SEAID529Type) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As SEAID529Type Return CType(SerializerXml.Deserialize(s), SEAID529Type) End Function #End Region ''' ''' Serializes current SEAID529Type 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an SEAID529Type object ''' ''' File to load and deserialize ''' Output SEAID529Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As SEAID529Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SEAID529Type) Try obj = LoadFromFile(fileName, encoding) 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 SEAID529Type, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SEAID529Type) 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 SEAID529Type Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As SEAID529Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class PERLODSUMDECType #Region "Private fields" Private _namPLD1 As String Private _strAndNumPLD1 As String Private _posCodPLD1 As String Private _citPLD1 As String Private _couCodPLD1 As String Private _pERLODSUMDECLNG As String Private _tINPLD1 As String Private Shared _serializerXml As XmlSerializer #End Region Public Property NamPLD1() As String Get Return Me._namPLD1 End Get Set Me._namPLD1 = Value End Set End Property Public Property StrAndNumPLD1() As String Get Return Me._strAndNumPLD1 End Get Set Me._strAndNumPLD1 = Value End Set End Property Public Property PosCodPLD1() As String Get Return Me._posCodPLD1 End Get Set Me._posCodPLD1 = Value End Set End Property Public Property CitPLD1() As String Get Return Me._citPLD1 End Get Set Me._citPLD1 = Value End Set End Property Public Property CouCodPLD1() As String Get Return Me._couCodPLD1 End Get Set Me._couCodPLD1 = Value End Set End Property Public Property PERLODSUMDECLNG() As String Get Return Me._pERLODSUMDECLNG End Get Set Me._pERLODSUMDECLNG = Value End Set End Property Public Property TINPLD1() As String Get Return Me._tINPLD1 End Get Set Me._tINPLD1 = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PERLODSUMDECType)) End If Return _serializerXml End Get End Property ''' ''' Test whether NamPLD1 should be serialized ''' Public Overridable Function ShouldSerializeNamPLD1() As Boolean Return Not String.IsNullOrEmpty(NamPLD1) End Function ''' ''' Test whether StrAndNumPLD1 should be serialized ''' Public Overridable Function ShouldSerializeStrAndNumPLD1() As Boolean Return Not String.IsNullOrEmpty(StrAndNumPLD1) End Function ''' ''' Test whether PosCodPLD1 should be serialized ''' Public Overridable Function ShouldSerializePosCodPLD1() As Boolean Return Not String.IsNullOrEmpty(PosCodPLD1) End Function ''' ''' Test whether CitPLD1 should be serialized ''' Public Overridable Function ShouldSerializeCitPLD1() As Boolean Return Not String.IsNullOrEmpty(CitPLD1) End Function ''' ''' Test whether CouCodPLD1 should be serialized ''' Public Overridable Function ShouldSerializeCouCodPLD1() As Boolean Return Not String.IsNullOrEmpty(CouCodPLD1) End Function ''' ''' Test whether PERLODSUMDECLNG should be serialized ''' Public Overridable Function ShouldSerializePERLODSUMDECLNG() As Boolean Return Not String.IsNullOrEmpty(PERLODSUMDECLNG) End Function ''' ''' Test whether TINPLD1 should be serialized ''' Public Overridable Function ShouldSerializeTINPLD1() As Boolean Return Not String.IsNullOrEmpty(TINPLD1) End Function #Region "Serialize/Deserialize" ''' ''' Serialize PERLODSUMDECType object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes PERLODSUMDECType object ''' ''' string to deserialize ''' Output PERLODSUMDECType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PERLODSUMDECType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PERLODSUMDECType) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PERLODSUMDECType) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As PERLODSUMDECType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PERLODSUMDECType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As PERLODSUMDECType Return CType(SerializerXml.Deserialize(s), PERLODSUMDECType) End Function #End Region ''' ''' Serializes current PERLODSUMDECType 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an PERLODSUMDECType object ''' ''' File to load and deserialize ''' Output PERLODSUMDECType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As PERLODSUMDECType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PERLODSUMDECType) Try obj = LoadFromFile(fileName, encoding) 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 PERLODSUMDECType, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PERLODSUMDECType) 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 PERLODSUMDECType Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As PERLODSUMDECType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class TRAREPType #Region "Private fields" Private _namTRE1 As String Private _strAndNumTRE1 As String Private _posCodTRE1 As String Private _citTRE1 As String Private _couCodTRE1 As String Private _tRAREPLNG As String Private _tINTRE1 As String Private Shared _serializerXml As XmlSerializer #End Region Public Property NamTRE1() As String Get Return Me._namTRE1 End Get Set Me._namTRE1 = Value End Set End Property Public Property StrAndNumTRE1() As String Get Return Me._strAndNumTRE1 End Get Set Me._strAndNumTRE1 = Value End Set End Property Public Property PosCodTRE1() As String Get Return Me._posCodTRE1 End Get Set Me._posCodTRE1 = Value End Set End Property Public Property CitTRE1() As String Get Return Me._citTRE1 End Get Set Me._citTRE1 = Value End Set End Property Public Property CouCodTRE1() As String Get Return Me._couCodTRE1 End Get Set Me._couCodTRE1 = Value End Set End Property Public Property TRAREPLNG() As String Get Return Me._tRAREPLNG End Get Set Me._tRAREPLNG = Value End Set End Property Public Property TINTRE1() As String Get Return Me._tINTRE1 End Get Set Me._tINTRE1 = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRAREPType)) End If Return _serializerXml End Get End Property ''' ''' Test whether NamTRE1 should be serialized ''' Public Overridable Function ShouldSerializeNamTRE1() As Boolean Return Not String.IsNullOrEmpty(NamTRE1) End Function ''' ''' Test whether StrAndNumTRE1 should be serialized ''' Public Overridable Function ShouldSerializeStrAndNumTRE1() As Boolean Return Not String.IsNullOrEmpty(StrAndNumTRE1) End Function ''' ''' Test whether PosCodTRE1 should be serialized ''' Public Overridable Function ShouldSerializePosCodTRE1() As Boolean Return Not String.IsNullOrEmpty(PosCodTRE1) End Function ''' ''' Test whether CitTRE1 should be serialized ''' Public Overridable Function ShouldSerializeCitTRE1() As Boolean Return Not String.IsNullOrEmpty(CitTRE1) End Function ''' ''' Test whether CouCodTRE1 should be serialized ''' Public Overridable Function ShouldSerializeCouCodTRE1() As Boolean Return Not String.IsNullOrEmpty(CouCodTRE1) End Function ''' ''' Test whether TRAREPLNG should be serialized ''' Public Overridable Function ShouldSerializeTRAREPLNG() As Boolean Return Not String.IsNullOrEmpty(TRAREPLNG) End Function ''' ''' Test whether TINTRE1 should be serialized ''' Public Overridable Function ShouldSerializeTINTRE1() As Boolean Return Not String.IsNullOrEmpty(TINTRE1) End Function #Region "Serialize/Deserialize" ''' ''' Serialize TRAREPType object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes TRAREPType object ''' ''' string to deserialize ''' Output TRAREPType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRAREPType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TRAREPType) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRAREPType) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As TRAREPType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRAREPType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRAREPType Return CType(SerializerXml.Deserialize(s), TRAREPType) End Function #End Region ''' ''' Serializes current TRAREPType 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an TRAREPType object ''' ''' File to load and deserialize ''' Output TRAREPType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As TRAREPType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TRAREPType) Try obj = LoadFromFile(fileName, encoding) 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 TRAREPType, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRAREPType) 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 TRAREPType Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As TRAREPType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class CUSOFFLONType #Region "Private fields" Private _refNumCOL1 As String Private Shared _serializerXml As XmlSerializer #End Region Public Property RefNumCOL1() As String Get Return Me._refNumCOL1 End Get Set Me._refNumCOL1 = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CUSOFFLONType)) End If Return _serializerXml End Get End Property ''' ''' Test whether RefNumCOL1 should be serialized ''' Public Overridable Function ShouldSerializeRefNumCOL1() As Boolean Return Not String.IsNullOrEmpty(RefNumCOL1) End Function #Region "Serialize/Deserialize" ''' ''' Serialize CUSOFFLONType object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes CUSOFFLONType object ''' ''' string to deserialize ''' Output CUSOFFLONType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFLONType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CUSOFFLONType) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFLONType) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As CUSOFFLONType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CUSOFFLONType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As CUSOFFLONType Return CType(SerializerXml.Deserialize(s), CUSOFFLONType) End Function #End Region ''' ''' Serializes current CUSOFFLONType 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an CUSOFFLONType object ''' ''' File to load and deserialize ''' Output CUSOFFLONType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As CUSOFFLONType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CUSOFFLONType) Try obj = LoadFromFile(fileName, encoding) 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 CUSOFFLONType, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFLONType) 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 CUSOFFLONType Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As CUSOFFLONType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class ITIType #Region "Private fields" Private _couOfRouCodITI1 As String Private Shared _serializerXml As XmlSerializer #End Region Public Property CouOfRouCodITI1() As String Get Return Me._couOfRouCodITI1 End Get Set Me._couOfRouCodITI1 = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ITIType)) End If Return _serializerXml End Get End Property ''' ''' Test whether CouOfRouCodITI1 should be serialized ''' Public Overridable Function ShouldSerializeCouOfRouCodITI1() As Boolean Return Not String.IsNullOrEmpty(CouOfRouCodITI1) End Function #Region "Serialize/Deserialize" ''' ''' Serialize ITIType object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes ITIType object ''' ''' string to deserialize ''' Output ITIType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ITIType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ITIType) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ITIType) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As ITIType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ITIType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As ITIType Return CType(SerializerXml.Deserialize(s), ITIType) End Function #End Region ''' ''' Serializes current ITIType 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an ITIType object ''' ''' File to load and deserialize ''' Output ITIType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As ITIType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ITIType) Try obj = LoadFromFile(fileName, encoding) 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 ITIType, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ITIType) 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 ITIType Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As ITIType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class PRTNOT640Type #Region "Private fields" Private _namPRTNOT642 As String Private _strNumPRTNOT646 As String Private _pstCodPRTNOT644 As String Private _ctyPRTNOT643 As String Private _couCodGINOT647 As String Private _pRTNOT640LNG As String Private _tINPRTNOT641 As String Private Shared _serializerXml As XmlSerializer #End Region Public Property NamPRTNOT642() As String Get Return Me._namPRTNOT642 End Get Set Me._namPRTNOT642 = Value End Set End Property Public Property StrNumPRTNOT646() As String Get Return Me._strNumPRTNOT646 End Get Set Me._strNumPRTNOT646 = Value End Set End Property Public Property PstCodPRTNOT644() As String Get Return Me._pstCodPRTNOT644 End Get Set Me._pstCodPRTNOT644 = Value End Set End Property Public Property CtyPRTNOT643() As String Get Return Me._ctyPRTNOT643 End Get Set Me._ctyPRTNOT643 = Value End Set End Property Public Property CouCodGINOT647() As String Get Return Me._couCodGINOT647 End Get Set Me._couCodGINOT647 = Value End Set End Property Public Property PRTNOT640LNG() As String Get Return Me._pRTNOT640LNG End Get Set Me._pRTNOT640LNG = Value End Set End Property Public Property TINPRTNOT641() As String Get Return Me._tINPRTNOT641 End Get Set Me._tINPRTNOT641 = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PRTNOT640Type)) End If Return _serializerXml End Get End Property ''' ''' Test whether NamPRTNOT642 should be serialized ''' Public Overridable Function ShouldSerializeNamPRTNOT642() As Boolean Return Not String.IsNullOrEmpty(NamPRTNOT642) End Function ''' ''' Test whether StrNumPRTNOT646 should be serialized ''' Public Overridable Function ShouldSerializeStrNumPRTNOT646() As Boolean Return Not String.IsNullOrEmpty(StrNumPRTNOT646) End Function ''' ''' Test whether PstCodPRTNOT644 should be serialized ''' Public Overridable Function ShouldSerializePstCodPRTNOT644() As Boolean Return Not String.IsNullOrEmpty(PstCodPRTNOT644) End Function ''' ''' Test whether CtyPRTNOT643 should be serialized ''' Public Overridable Function ShouldSerializeCtyPRTNOT643() As Boolean Return Not String.IsNullOrEmpty(CtyPRTNOT643) End Function ''' ''' Test whether CouCodGINOT647 should be serialized ''' Public Overridable Function ShouldSerializeCouCodGINOT647() As Boolean Return Not String.IsNullOrEmpty(CouCodGINOT647) End Function ''' ''' Test whether PRTNOT640LNG should be serialized ''' Public Overridable Function ShouldSerializePRTNOT640LNG() As Boolean Return Not String.IsNullOrEmpty(PRTNOT640LNG) End Function ''' ''' Test whether TINPRTNOT641 should be serialized ''' Public Overridable Function ShouldSerializeTINPRTNOT641() As Boolean Return Not String.IsNullOrEmpty(TINPRTNOT641) End Function #Region "Serialize/Deserialize" ''' ''' Serialize PRTNOT640Type object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes PRTNOT640Type object ''' ''' string to deserialize ''' Output PRTNOT640Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PRTNOT640Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PRTNOT640Type) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PRTNOT640Type) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As PRTNOT640Type Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PRTNOT640Type) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As PRTNOT640Type Return CType(SerializerXml.Deserialize(s), PRTNOT640Type) End Function #End Region ''' ''' Serializes current PRTNOT640Type 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an PRTNOT640Type object ''' ''' File to load and deserialize ''' Output PRTNOT640Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As PRTNOT640Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PRTNOT640Type) Try obj = LoadFromFile(fileName, encoding) 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 PRTNOT640Type, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PRTNOT640Type) 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 PRTNOT640Type Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As PRTNOT640Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class PACGS2Type #Region "Private fields" Private _kinOfPacGS23 As String Private _numOfPacGS24 As String Private _numOfPieGS25 As String Private _marNumOfPacGSL21 As String Private _marNumOfPacGSL21LNG As String Private Shared _serializerXml As XmlSerializer #End Region Public Property KinOfPacGS23() As String Get Return Me._kinOfPacGS23 End Get Set(ByVal value As String) Me._kinOfPacGS23 = value End Set End Property Public Property NumOfPacGS24() As String Get Return Me._numOfPacGS24 End Get Set(ByVal value As String) Me._numOfPacGS24 = value End Set End Property Public Property NumOfPieGS25() As String Get Return Me._numOfPieGS25 End Get Set(ByVal value As String) Me._numOfPieGS25 = value End Set End Property Public Property MarNumOfPacGSL21() As String Get Return Me._marNumOfPacGSL21 End Get Set(ByVal value As String) Me._marNumOfPacGSL21 = value End Set End Property Public Property MarNumOfPacGSL21LNG() As String Get Return Me._marNumOfPacGSL21LNG End Get Set(ByVal value As String) Me._marNumOfPacGSL21LNG = value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PACGS2Type)) End If Return _serializerXml End Get End Property ''' ''' Test whether KinOfPacGS23 should be serialized ''' Public Overridable Function ShouldSerializeKinOfPacGS23() As Boolean Return Not String.IsNullOrEmpty(KinOfPacGS23) End Function ''' ''' Test whether NumOfPacGS24 should be serialized ''' Public Overridable Function ShouldSerializeNumOfPacGS24() As Boolean Return Not String.IsNullOrEmpty(NumOfPacGS24) End Function ''' ''' Test whether NumOfPieGS25 should be serialized ''' Public Overridable Function ShouldSerializeNumOfPieGS25() As Boolean Return Not String.IsNullOrEmpty(NumOfPieGS25) End Function ''' ''' Test whether MarNumOfPacGSL21 should be serialized ''' Public Overridable Function ShouldSerializeMarNumOfPacGSL21() As Boolean Return Not String.IsNullOrEmpty(MarNumOfPacGSL21) End Function ''' ''' Test whether MarNumOfPacGSL21LNG should be serialized ''' Public Overridable Function ShouldSerializeMarNumOfPacGSL21LNG() As Boolean Return Not String.IsNullOrEmpty(MarNumOfPacGSL21LNG) End Function #Region "Serialize/Deserialize" ''' ''' Serialize PACGS2Type object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes PACGS2Type object ''' ''' string to deserialize ''' Output PACGS2Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PACGS2Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PACGS2Type) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PACGS2Type) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As PACGS2Type Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PACGS2Type) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As PACGS2Type Return CType(SerializerXml.Deserialize(s), PACGS2Type) End Function #End Region ''' ''' Serializes current PACGS2Type 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an PACGS2Type object ''' ''' File to load and deserialize ''' Output PACGS2Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As PACGS2Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PACGS2Type) Try obj = LoadFromFile(fileName, encoding) 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 PACGS2Type, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PACGS2Type) 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 PACGS2Type Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As PACGS2Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class IDEMEATRAGI970Type #Region "Private fields" Private _natIDEMEATRAGI973 As String Private _ideMeaTraGIMEATRA971 As String Private _ideMeaTraGIMEATRA972LNG As String Private Shared _serializerXml As XmlSerializer #End Region Public Property NatIDEMEATRAGI973() As String Get Return Me._natIDEMEATRAGI973 End Get Set Me._natIDEMEATRAGI973 = Value End Set End Property Public Property IdeMeaTraGIMEATRA971() As String Get Return Me._ideMeaTraGIMEATRA971 End Get Set Me._ideMeaTraGIMEATRA971 = Value End Set End Property Public Property IdeMeaTraGIMEATRA972LNG() As String Get Return Me._ideMeaTraGIMEATRA972LNG End Get Set Me._ideMeaTraGIMEATRA972LNG = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(IDEMEATRAGI970Type)) End If Return _serializerXml End Get End Property ''' ''' Test whether NatIDEMEATRAGI973 should be serialized ''' Public Overridable Function ShouldSerializeNatIDEMEATRAGI973() As Boolean Return Not String.IsNullOrEmpty(NatIDEMEATRAGI973) End Function ''' ''' Test whether IdeMeaTraGIMEATRA971 should be serialized ''' Public Overridable Function ShouldSerializeIdeMeaTraGIMEATRA971() As Boolean Return Not String.IsNullOrEmpty(IdeMeaTraGIMEATRA971) End Function ''' ''' Test whether IdeMeaTraGIMEATRA972LNG should be serialized ''' Public Overridable Function ShouldSerializeIdeMeaTraGIMEATRA972LNG() As Boolean Return Not String.IsNullOrEmpty(IdeMeaTraGIMEATRA972LNG) End Function #Region "Serialize/Deserialize" ''' ''' Serialize IDEMEATRAGI970Type object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes IDEMEATRAGI970Type object ''' ''' string to deserialize ''' Output IDEMEATRAGI970Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As IDEMEATRAGI970Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, IDEMEATRAGI970Type) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As IDEMEATRAGI970Type) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As IDEMEATRAGI970Type Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), IDEMEATRAGI970Type) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As IDEMEATRAGI970Type Return CType(SerializerXml.Deserialize(s), IDEMEATRAGI970Type) End Function #End Region ''' ''' Serializes current IDEMEATRAGI970Type 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an IDEMEATRAGI970Type object ''' ''' File to load and deserialize ''' Output IDEMEATRAGI970Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As IDEMEATRAGI970Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, IDEMEATRAGI970Type) Try obj = LoadFromFile(fileName, encoding) 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 IDEMEATRAGI970Type, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As IDEMEATRAGI970Type) 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 IDEMEATRAGI970Type Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As IDEMEATRAGI970Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class CONNR2Type #Region "Private fields" Private _conNumNR21 As String Private Shared _serializerXml As XmlSerializer #End Region Public Property ConNumNR21() As String Get Return Me._conNumNR21 End Get Set Me._conNumNR21 = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CONNR2Type)) End If Return _serializerXml End Get End Property ''' ''' Test whether ConNumNR21 should be serialized ''' Public Overridable Function ShouldSerializeConNumNR21() As Boolean Return Not String.IsNullOrEmpty(ConNumNR21) End Function #Region "Serialize/Deserialize" ''' ''' Serialize CONNR2Type object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes CONNR2Type object ''' ''' string to deserialize ''' Output CONNR2Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CONNR2Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CONNR2Type) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CONNR2Type) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As CONNR2Type Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CONNR2Type) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As CONNR2Type Return CType(SerializerXml.Deserialize(s), CONNR2Type) End Function #End Region ''' ''' Serializes current CONNR2Type 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an CONNR2Type object ''' ''' File to load and deserialize ''' Output CONNR2Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As CONNR2Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CONNR2Type) Try obj = LoadFromFile(fileName, encoding) 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 CONNR2Type, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CONNR2Type) 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 CONNR2Type Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As CONNR2Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class TRACONCE2Type #Region "Private fields" Private _namCE27 As String Private _strAndNumCE222 As String Private _posCodCE223 As String Private _citCE224 As String Private _couCE225 As String Private _nADLNGGICE As String Private _tINCE259 As String Private Shared _serializerXml As XmlSerializer #End Region Public Property NamCE27() As String Get Return Me._namCE27 End Get Set Me._namCE27 = Value End Set End Property Public Property StrAndNumCE222() As String Get Return Me._strAndNumCE222 End Get Set Me._strAndNumCE222 = Value End Set End Property Public Property PosCodCE223() As String Get Return Me._posCodCE223 End Get Set Me._posCodCE223 = Value End Set End Property Public Property CitCE224() As String Get Return Me._citCE224 End Get Set Me._citCE224 = Value End Set End Property Public Property CouCE225() As String Get Return Me._couCE225 End Get Set Me._couCE225 = Value End Set End Property Public Property NADLNGGICE() As String Get Return Me._nADLNGGICE End Get Set Me._nADLNGGICE = Value End Set End Property Public Property TINCE259() As String Get Return Me._tINCE259 End Get Set Me._tINCE259 = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRACONCE2Type)) End If Return _serializerXml End Get End Property ''' ''' Test whether NamCE27 should be serialized ''' Public Overridable Function ShouldSerializeNamCE27() As Boolean Return Not String.IsNullOrEmpty(NamCE27) End Function ''' ''' Test whether StrAndNumCE222 should be serialized ''' Public Overridable Function ShouldSerializeStrAndNumCE222() As Boolean Return Not String.IsNullOrEmpty(StrAndNumCE222) End Function ''' ''' Test whether PosCodCE223 should be serialized ''' Public Overridable Function ShouldSerializePosCodCE223() As Boolean Return Not String.IsNullOrEmpty(PosCodCE223) End Function ''' ''' Test whether CitCE224 should be serialized ''' Public Overridable Function ShouldSerializeCitCE224() As Boolean Return Not String.IsNullOrEmpty(CitCE224) End Function ''' ''' Test whether CouCE225 should be serialized ''' Public Overridable Function ShouldSerializeCouCE225() As Boolean Return Not String.IsNullOrEmpty(CouCE225) End Function ''' ''' Test whether NADLNGGICE should be serialized ''' Public Overridable Function ShouldSerializeNADLNGGICE() As Boolean Return Not String.IsNullOrEmpty(NADLNGGICE) End Function ''' ''' Test whether TINCE259 should be serialized ''' Public Overridable Function ShouldSerializeTINCE259() As Boolean Return Not String.IsNullOrEmpty(TINCE259) End Function #Region "Serialize/Deserialize" ''' ''' Serialize TRACONCE2Type object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes TRACONCE2Type object ''' ''' string to deserialize ''' Output TRACONCE2Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCE2Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TRACONCE2Type) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCE2Type) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As TRACONCE2Type Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRACONCE2Type) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRACONCE2Type Return CType(SerializerXml.Deserialize(s), TRACONCE2Type) End Function #End Region ''' ''' Serializes current TRACONCE2Type 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an TRACONCE2Type object ''' ''' File to load and deserialize ''' Output TRACONCE2Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As TRACONCE2Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TRACONCE2Type) Try obj = LoadFromFile(fileName, encoding) 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 TRACONCE2Type, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCE2Type) 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 TRACONCE2Type Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As TRACONCE2Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class COMCODGODITMType #Region "Private fields" Private _comNomCMD1 As String Private Shared _serializerXml As XmlSerializer #End Region Public Property ComNomCMD1() As String Get Return Me._comNomCMD1 End Get Set Me._comNomCMD1 = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(COMCODGODITMType)) End If Return _serializerXml End Get End Property ''' ''' Test whether ComNomCMD1 should be serialized ''' Public Overridable Function ShouldSerializeComNomCMD1() As Boolean Return Not String.IsNullOrEmpty(ComNomCMD1) End Function #Region "Serialize/Deserialize" ''' ''' Serialize COMCODGODITMType object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes COMCODGODITMType object ''' ''' string to deserialize ''' Output COMCODGODITMType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As COMCODGODITMType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, COMCODGODITMType) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As COMCODGODITMType) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As COMCODGODITMType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), COMCODGODITMType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As COMCODGODITMType Return CType(SerializerXml.Deserialize(s), COMCODGODITMType) End Function #End Region ''' ''' Serializes current COMCODGODITMType 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an COMCODGODITMType object ''' ''' File to load and deserialize ''' Output COMCODGODITMType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As COMCODGODITMType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, COMCODGODITMType) Try obj = LoadFromFile(fileName, encoding) 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 COMCODGODITMType, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As COMCODGODITMType) 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 COMCODGODITMType Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As COMCODGODITMType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class TRACONCO2Type #Region "Private fields" Private _namCO27 As String Private _strAndNumCO222 As String Private _posCodCO223 As String Private _citCO224 As String Private _couCO225 As String Private _nADLNGGTCO As String Private _tINCO259 As String Private Shared _serializerXml As XmlSerializer #End Region Public Property NamCO27() As String Get Return Me._namCO27 End Get Set Me._namCO27 = Value End Set End Property Public Property StrAndNumCO222() As String Get Return Me._strAndNumCO222 End Get Set Me._strAndNumCO222 = Value End Set End Property Public Property PosCodCO223() As String Get Return Me._posCodCO223 End Get Set Me._posCodCO223 = Value End Set End Property Public Property CitCO224() As String Get Return Me._citCO224 End Get Set Me._citCO224 = Value End Set End Property Public Property CouCO225() As String Get Return Me._couCO225 End Get Set Me._couCO225 = Value End Set End Property Public Property NADLNGGTCO() As String Get Return Me._nADLNGGTCO End Get Set Me._nADLNGGTCO = Value End Set End Property Public Property TINCO259() As String Get Return Me._tINCO259 End Get Set Me._tINCO259 = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRACONCO2Type)) End If Return _serializerXml End Get End Property ''' ''' Test whether NamCO27 should be serialized ''' Public Overridable Function ShouldSerializeNamCO27() As Boolean Return Not String.IsNullOrEmpty(NamCO27) End Function ''' ''' Test whether StrAndNumCO222 should be serialized ''' Public Overridable Function ShouldSerializeStrAndNumCO222() As Boolean Return Not String.IsNullOrEmpty(StrAndNumCO222) End Function ''' ''' Test whether PosCodCO223 should be serialized ''' Public Overridable Function ShouldSerializePosCodCO223() As Boolean Return Not String.IsNullOrEmpty(PosCodCO223) End Function ''' ''' Test whether CitCO224 should be serialized ''' Public Overridable Function ShouldSerializeCitCO224() As Boolean Return Not String.IsNullOrEmpty(CitCO224) End Function ''' ''' Test whether CouCO225 should be serialized ''' Public Overridable Function ShouldSerializeCouCO225() As Boolean Return Not String.IsNullOrEmpty(CouCO225) End Function ''' ''' Test whether NADLNGGTCO should be serialized ''' Public Overridable Function ShouldSerializeNADLNGGTCO() As Boolean Return Not String.IsNullOrEmpty(NADLNGGTCO) End Function ''' ''' Test whether TINCO259 should be serialized ''' Public Overridable Function ShouldSerializeTINCO259() As Boolean Return Not String.IsNullOrEmpty(TINCO259) End Function #Region "Serialize/Deserialize" ''' ''' Serialize TRACONCO2Type object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes TRACONCO2Type object ''' ''' string to deserialize ''' Output TRACONCO2Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCO2Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TRACONCO2Type) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCO2Type) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As TRACONCO2Type Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRACONCO2Type) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRACONCO2Type Return CType(SerializerXml.Deserialize(s), TRACONCO2Type) End Function #End Region ''' ''' Serializes current TRACONCO2Type 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an TRACONCO2Type object ''' ''' File to load and deserialize ''' Output TRACONCO2Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As TRACONCO2Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TRACONCO2Type) Try obj = LoadFromFile(fileName, encoding) 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 TRACONCO2Type, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCO2Type) 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 TRACONCO2Type Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As TRACONCO2Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class SPEMENMT2Type #Region "Private fields" Private _addInfCodMT23 As String Private Shared _serializerXml As XmlSerializer #End Region Public Property AddInfCodMT23() As String Get Return Me._addInfCodMT23 End Get Set Me._addInfCodMT23 = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SPEMENMT2Type)) End If Return _serializerXml End Get End Property ''' ''' Test whether AddInfCodMT23 should be serialized ''' Public Overridable Function ShouldSerializeAddInfCodMT23() As Boolean Return Not String.IsNullOrEmpty(AddInfCodMT23) End Function #Region "Serialize/Deserialize" ''' ''' Serialize SPEMENMT2Type object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes SPEMENMT2Type object ''' ''' string to deserialize ''' Output SPEMENMT2Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As SPEMENMT2Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SPEMENMT2Type) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As SPEMENMT2Type) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As SPEMENMT2Type Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SPEMENMT2Type) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As SPEMENMT2Type Return CType(SerializerXml.Deserialize(s), SPEMENMT2Type) End Function #End Region ''' ''' Serializes current SPEMENMT2Type 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an SPEMENMT2Type object ''' ''' File to load and deserialize ''' Output SPEMENMT2Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As SPEMENMT2Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SPEMENMT2Type) Try obj = LoadFromFile(fileName, encoding) 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 SPEMENMT2Type, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SPEMENMT2Type) 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 SPEMENMT2Type Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As SPEMENMT2Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class PRODOCDC2Type #Region "Private fields" Private _docTypDC21 As String Private _docRefDC23 As String Private _docRefDCLNG As String Private Shared _serializerXml As XmlSerializer #End Region Public Property DocTypDC21() As String Get Return Me._docTypDC21 End Get Set(ByVal Value As String) Me._docTypDC21 = Value End Set End Property Public Property DocRefDC23() As String Get Return Me._docRefDC23 End Get Set(ByVal Value As String) Me._docRefDC23 = Value End Set End Property Public Property DocRefDCLNG() As String Get Return Me._docRefDCLNG End Get Set(ByVal Value As String) Me._docRefDCLNG = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PRODOCDC2Type)) End If Return _serializerXml End Get End Property ''' ''' Test whether DocTypDC21 should be serialized ''' Public Overridable Function ShouldSerializeDocTypDC21() As Boolean Return Not String.IsNullOrEmpty(DocTypDC21) End Function ''' ''' Test whether DocRefDC23 should be serialized ''' Public Overridable Function ShouldSerializeDocRefDC23() As Boolean Return Not String.IsNullOrEmpty(DocRefDC23) End Function ''' ''' Test whether DocRefDCLNG should be serialized ''' Public Overridable Function ShouldSerializeDocRefDCLNG() As Boolean Return Not String.IsNullOrEmpty(DocRefDCLNG) End Function #Region "Serialize/Deserialize" ''' ''' Serialize PRODOCDC2Type object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes PRODOCDC2Type object ''' ''' string to deserialize ''' Output PRODOCDC2Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PRODOCDC2Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PRODOCDC2Type) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PRODOCDC2Type) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As PRODOCDC2Type Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PRODOCDC2Type) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As PRODOCDC2Type Return CType(SerializerXml.Deserialize(s), PRODOCDC2Type) End Function #End Region ''' ''' Serializes current PRODOCDC2Type 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an PRODOCDC2Type object ''' ''' File to load and deserialize ''' Output PRODOCDC2Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As PRODOCDC2Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PRODOCDC2Type) Try obj = LoadFromFile(fileName, encoding) 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 PRODOCDC2Type, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PRODOCDC2Type) 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 PRODOCDC2Type Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As PRODOCDC2Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class GOOITEGDSType #Region "Private fields" Private _shouldSerializeGroMasGDS46 As Boolean Private _iteNumGDS7 As String Private _gooDesGDS23 As String Private _gooDesGDS23LNG As String Private _groMasGDS46 As Decimal Private _metOfPayGDI12 As String Private _comRefNumGIM1 As String Private _uNDanGooCodGDI1 As String Private _plaLoaGOOITE333 As String Private _plaLoaGOOITE333LNG As String Private _plaUnlGOOITE333 As String Private _plaUnlGOOITE333LNG As String Private _pRODOCDC2 As List(Of PRODOCDC2Type) Private _sPEMENMT2 As List(Of SPEMENMT2Type) Private _tRACONCO2 As TRACONCO2Type Private _cOMCODGODITM As COMCODGODITMType Private _tRACONCE2 As TRACONCE2Type Private _cONNR2 As List(Of CONNR2Type) Private _iDEMEATRAGI970 As List(Of IDEMEATRAGI970Type) Private _pACGS2 As List(Of PACGS2Type) Private _pRTNOT640 As PRTNOT640Type Private Shared _serializerXml As XmlSerializer #End Region Public Property IteNumGDS7() As String Get Return Me._iteNumGDS7 End Get Set Me._iteNumGDS7 = Value End Set End Property Public Property GooDesGDS23() As String Get Return Me._gooDesGDS23 End Get Set Me._gooDesGDS23 = Value End Set End Property Public Property GooDesGDS23LNG() As String Get Return Me._gooDesGDS23LNG End Get Set Me._gooDesGDS23LNG = Value End Set End Property Public Property GroMasGDS46() As Decimal Get Return Me._groMasGDS46 End Get Set Me._groMasGDS46 = Value _shouldSerializeGroMasGDS46 = True End Set End Property Public Property MetOfPayGDI12() As String Get Return Me._metOfPayGDI12 End Get Set Me._metOfPayGDI12 = Value End Set End Property Public Property ComRefNumGIM1() As String Get Return Me._comRefNumGIM1 End Get Set Me._comRefNumGIM1 = Value End Set End Property Public Property UNDanGooCodGDI1() As String Get Return Me._uNDanGooCodGDI1 End Get Set Me._uNDanGooCodGDI1 = Value End Set End Property Public Property PlaLoaGOOITE333() As String Get Return Me._plaLoaGOOITE333 End Get Set Me._plaLoaGOOITE333 = Value End Set End Property Public Property PlaLoaGOOITE333LNG() As String Get Return Me._plaLoaGOOITE333LNG End Get Set Me._plaLoaGOOITE333LNG = Value End Set End Property Public Property PlaUnlGOOITE333() As String Get Return Me._plaUnlGOOITE333 End Get Set Me._plaUnlGOOITE333 = Value End Set End Property Public Property PlaUnlGOOITE333LNG() As String Get Return Me._plaUnlGOOITE333LNG End Get Set Me._plaUnlGOOITE333LNG = Value End Set End Property Public Property PRODOCDC2() As List(Of PRODOCDC2Type) Get Return Me._pRODOCDC2 End Get Set Me._pRODOCDC2 = Value End Set End Property Public Property SPEMENMT2() As List(Of SPEMENMT2Type) Get Return Me._sPEMENMT2 End Get Set Me._sPEMENMT2 = Value End Set End Property Public Property TRACONCO2() As TRACONCO2Type Get Return Me._tRACONCO2 End Get Set Me._tRACONCO2 = Value End Set End Property Public Property COMCODGODITM() As COMCODGODITMType Get Return Me._cOMCODGODITM End Get Set Me._cOMCODGODITM = Value End Set End Property Public Property TRACONCE2() As TRACONCE2Type Get Return Me._tRACONCE2 End Get Set Me._tRACONCE2 = Value End Set End Property Public Property CONNR2() As List(Of CONNR2Type) Get Return Me._cONNR2 End Get Set Me._cONNR2 = Value End Set End Property Public Property IDEMEATRAGI970() As List(Of IDEMEATRAGI970Type) Get Return Me._iDEMEATRAGI970 End Get Set Me._iDEMEATRAGI970 = Value End Set End Property Public Property PACGS2() As List(Of PACGS2Type) Get Return Me._pACGS2 End Get Set Me._pACGS2 = Value End Set End Property Public Property PRTNOT640() As PRTNOT640Type Get Return Me._pRTNOT640 End Get Set Me._pRTNOT640 = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(GOOITEGDSType)) End If Return _serializerXml End Get End Property ''' ''' Test whether PRODOCDC2 should be serialized ''' Public Overridable Function ShouldSerializePRODOCDC2() As Boolean Return PRODOCDC2 IsNot Nothing AndAlso PRODOCDC2.Count > 0 End Function ''' ''' Test whether SPEMENMT2 should be serialized ''' Public Overridable Function ShouldSerializeSPEMENMT2() As Boolean Return SPEMENMT2 IsNot Nothing AndAlso SPEMENMT2.Count > 0 End Function ''' ''' Test whether CONNR2 should be serialized ''' Public Overridable Function ShouldSerializeCONNR2() As Boolean Return CONNR2 IsNot Nothing AndAlso CONNR2.Count > 0 End Function ''' ''' Test whether IDEMEATRAGI970 should be serialized ''' Public Overridable Function ShouldSerializeIDEMEATRAGI970() As Boolean Return IDEMEATRAGI970 IsNot Nothing AndAlso IDEMEATRAGI970.Count > 0 End Function ''' ''' Test whether PACGS2 should be serialized ''' Public Overridable Function ShouldSerializePACGS2() As Boolean Return PACGS2 IsNot Nothing AndAlso PACGS2.Count > 0 End Function ''' ''' Test whether GroMasGDS46 should be serialized ''' Public Overridable Function ShouldSerializeGroMasGDS46() As Boolean Return (Equals(_groMasGDS46, Nothing) <> True) End Function ''' ''' Test whether TRACONCO2 should be serialized ''' Public Overridable Function ShouldSerializeTRACONCO2() As Boolean Return (Equals(_tRACONCO2, Nothing) <> True) End Function ''' ''' Test whether COMCODGODITM should be serialized ''' Public Overridable Function ShouldSerializeCOMCODGODITM() As Boolean Return (Equals(_cOMCODGODITM, Nothing) <> True) End Function ''' ''' Test whether TRACONCE2 should be serialized ''' Public Overridable Function ShouldSerializeTRACONCE2() As Boolean Return (Equals(_tRACONCE2, Nothing) <> True) End Function ''' ''' Test whether PRTNOT640 should be serialized ''' Public Overridable Function ShouldSerializePRTNOT640() As Boolean Return (Equals(_pRTNOT640, Nothing) <> True) End Function ''' ''' Test whether IteNumGDS7 should be serialized ''' Public Overridable Function ShouldSerializeIteNumGDS7() As Boolean Return Not String.IsNullOrEmpty(IteNumGDS7) End Function ''' ''' Test whether GooDesGDS23 should be serialized ''' Public Overridable Function ShouldSerializeGooDesGDS23() As Boolean Return Not String.IsNullOrEmpty(GooDesGDS23) End Function ''' ''' Test whether GooDesGDS23LNG should be serialized ''' Public Overridable Function ShouldSerializeGooDesGDS23LNG() As Boolean Return Not String.IsNullOrEmpty(GooDesGDS23LNG) End Function ''' ''' Test whether MetOfPayGDI12 should be serialized ''' Public Overridable Function ShouldSerializeMetOfPayGDI12() As Boolean Return Not String.IsNullOrEmpty(MetOfPayGDI12) End Function ''' ''' Test whether ComRefNumGIM1 should be serialized ''' Public Overridable Function ShouldSerializeComRefNumGIM1() As Boolean Return Not String.IsNullOrEmpty(ComRefNumGIM1) End Function ''' ''' Test whether UNDanGooCodGDI1 should be serialized ''' Public Overridable Function ShouldSerializeUNDanGooCodGDI1() As Boolean Return Not String.IsNullOrEmpty(UNDanGooCodGDI1) End Function ''' ''' Test whether PlaLoaGOOITE333 should be serialized ''' Public Overridable Function ShouldSerializePlaLoaGOOITE333() As Boolean Return Not String.IsNullOrEmpty(PlaLoaGOOITE333) End Function ''' ''' Test whether PlaLoaGOOITE333LNG should be serialized ''' Public Overridable Function ShouldSerializePlaLoaGOOITE333LNG() As Boolean Return Not String.IsNullOrEmpty(PlaLoaGOOITE333LNG) End Function ''' ''' Test whether PlaUnlGOOITE333 should be serialized ''' Public Overridable Function ShouldSerializePlaUnlGOOITE333() As Boolean Return Not String.IsNullOrEmpty(PlaUnlGOOITE333) End Function ''' ''' Test whether PlaUnlGOOITE333LNG should be serialized ''' Public Overridable Function ShouldSerializePlaUnlGOOITE333LNG() As Boolean Return Not String.IsNullOrEmpty(PlaUnlGOOITE333LNG) End Function #Region "Serialize/Deserialize" ''' ''' Serialize GOOITEGDSType object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes GOOITEGDSType object ''' ''' string to deserialize ''' Output GOOITEGDSType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As GOOITEGDSType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GOOITEGDSType) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As GOOITEGDSType) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As GOOITEGDSType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), GOOITEGDSType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As GOOITEGDSType Return CType(SerializerXml.Deserialize(s), GOOITEGDSType) End Function #End Region ''' ''' Serializes current GOOITEGDSType 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an GOOITEGDSType object ''' ''' File to load and deserialize ''' Output GOOITEGDSType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As GOOITEGDSType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GOOITEGDSType) Try obj = LoadFromFile(fileName, encoding) 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 GOOITEGDSType, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As GOOITEGDSType) 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 GOOITEGDSType Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As GOOITEGDSType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class NOTPAR670Type #Region "Private fields" Private _namNOTPAR672 As String Private _strNumNOTPAR673 As String Private _posCodNOTPAR676 As String Private _citNOTPAR674 As String Private _couCodNOTPAR675 As String Private _nOTPAR670LNG As String Private _tINNOTPAR671 As String Private Shared _serializerXml As XmlSerializer #End Region Public Property NamNOTPAR672() As String Get Return Me._namNOTPAR672 End Get Set Me._namNOTPAR672 = Value End Set End Property Public Property StrNumNOTPAR673() As String Get Return Me._strNumNOTPAR673 End Get Set Me._strNumNOTPAR673 = Value End Set End Property Public Property PosCodNOTPAR676() As String Get Return Me._posCodNOTPAR676 End Get Set Me._posCodNOTPAR676 = Value End Set End Property Public Property CitNOTPAR674() As String Get Return Me._citNOTPAR674 End Get Set Me._citNOTPAR674 = Value End Set End Property Public Property CouCodNOTPAR675() As String Get Return Me._couCodNOTPAR675 End Get Set Me._couCodNOTPAR675 = Value End Set End Property Public Property NOTPAR670LNG() As String Get Return Me._nOTPAR670LNG End Get Set Me._nOTPAR670LNG = Value End Set End Property Public Property TINNOTPAR671() As String Get Return Me._tINNOTPAR671 End Get Set Me._tINNOTPAR671 = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(NOTPAR670Type)) End If Return _serializerXml End Get End Property ''' ''' Test whether NamNOTPAR672 should be serialized ''' Public Overridable Function ShouldSerializeNamNOTPAR672() As Boolean Return Not String.IsNullOrEmpty(NamNOTPAR672) End Function ''' ''' Test whether StrNumNOTPAR673 should be serialized ''' Public Overridable Function ShouldSerializeStrNumNOTPAR673() As Boolean Return Not String.IsNullOrEmpty(StrNumNOTPAR673) End Function ''' ''' Test whether PosCodNOTPAR676 should be serialized ''' Public Overridable Function ShouldSerializePosCodNOTPAR676() As Boolean Return Not String.IsNullOrEmpty(PosCodNOTPAR676) End Function ''' ''' Test whether CitNOTPAR674 should be serialized ''' Public Overridable Function ShouldSerializeCitNOTPAR674() As Boolean Return Not String.IsNullOrEmpty(CitNOTPAR674) End Function ''' ''' Test whether CouCodNOTPAR675 should be serialized ''' Public Overridable Function ShouldSerializeCouCodNOTPAR675() As Boolean Return Not String.IsNullOrEmpty(CouCodNOTPAR675) End Function ''' ''' Test whether NOTPAR670LNG should be serialized ''' Public Overridable Function ShouldSerializeNOTPAR670LNG() As Boolean Return Not String.IsNullOrEmpty(NOTPAR670LNG) End Function ''' ''' Test whether TINNOTPAR671 should be serialized ''' Public Overridable Function ShouldSerializeTINNOTPAR671() As Boolean Return Not String.IsNullOrEmpty(TINNOTPAR671) End Function #Region "Serialize/Deserialize" ''' ''' Serialize NOTPAR670Type object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes NOTPAR670Type object ''' ''' string to deserialize ''' Output NOTPAR670Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As NOTPAR670Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, NOTPAR670Type) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As NOTPAR670Type) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As NOTPAR670Type Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), NOTPAR670Type) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As NOTPAR670Type Return CType(SerializerXml.Deserialize(s), NOTPAR670Type) End Function #End Region ''' ''' Serializes current NOTPAR670Type 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an NOTPAR670Type object ''' ''' File to load and deserialize ''' Output NOTPAR670Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As NOTPAR670Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, NOTPAR670Type) Try obj = LoadFromFile(fileName, encoding) 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 NOTPAR670Type, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As NOTPAR670Type) 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 NOTPAR670Type Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As NOTPAR670Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class TRACONCE1Type #Region "Private fields" Private _namCE17 As String Private _strAndNumCE122 As String Private _posCodCE123 As String Private _citCE124 As String Private _couCE125 As String Private _nADLNGCE As String Private _tINCE159 As String Private Shared _serializerXml As XmlSerializer #End Region Public Property NamCE17() As String Get Return Me._namCE17 End Get Set Me._namCE17 = Value End Set End Property Public Property StrAndNumCE122() As String Get Return Me._strAndNumCE122 End Get Set Me._strAndNumCE122 = Value End Set End Property Public Property PosCodCE123() As String Get Return Me._posCodCE123 End Get Set Me._posCodCE123 = Value End Set End Property Public Property CitCE124() As String Get Return Me._citCE124 End Get Set Me._citCE124 = Value End Set End Property Public Property CouCE125() As String Get Return Me._couCE125 End Get Set Me._couCE125 = Value End Set End Property Public Property NADLNGCE() As String Get Return Me._nADLNGCE End Get Set Me._nADLNGCE = Value End Set End Property Public Property TINCE159() As String Get Return Me._tINCE159 End Get Set Me._tINCE159 = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRACONCE1Type)) End If Return _serializerXml End Get End Property ''' ''' Test whether NamCE17 should be serialized ''' Public Overridable Function ShouldSerializeNamCE17() As Boolean Return Not String.IsNullOrEmpty(NamCE17) End Function ''' ''' Test whether StrAndNumCE122 should be serialized ''' Public Overridable Function ShouldSerializeStrAndNumCE122() As Boolean Return Not String.IsNullOrEmpty(StrAndNumCE122) End Function ''' ''' Test whether PosCodCE123 should be serialized ''' Public Overridable Function ShouldSerializePosCodCE123() As Boolean Return Not String.IsNullOrEmpty(PosCodCE123) End Function ''' ''' Test whether CitCE124 should be serialized ''' Public Overridable Function ShouldSerializeCitCE124() As Boolean Return Not String.IsNullOrEmpty(CitCE124) End Function ''' ''' Test whether CouCE125 should be serialized ''' Public Overridable Function ShouldSerializeCouCE125() As Boolean Return Not String.IsNullOrEmpty(CouCE125) End Function ''' ''' Test whether NADLNGCE should be serialized ''' Public Overridable Function ShouldSerializeNADLNGCE() As Boolean Return Not String.IsNullOrEmpty(NADLNGCE) End Function ''' ''' Test whether TINCE159 should be serialized ''' Public Overridable Function ShouldSerializeTINCE159() As Boolean Return Not String.IsNullOrEmpty(TINCE159) End Function #Region "Serialize/Deserialize" ''' ''' Serialize TRACONCE1Type object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes TRACONCE1Type object ''' ''' string to deserialize ''' Output TRACONCE1Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCE1Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TRACONCE1Type) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCE1Type) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As TRACONCE1Type Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRACONCE1Type) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRACONCE1Type Return CType(SerializerXml.Deserialize(s), TRACONCE1Type) End Function #End Region ''' ''' Serializes current TRACONCE1Type 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an TRACONCE1Type object ''' ''' File to load and deserialize ''' Output TRACONCE1Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As TRACONCE1Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TRACONCE1Type) Try obj = LoadFromFile(fileName, encoding) 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 TRACONCE1Type, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCE1Type) 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 TRACONCE1Type Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As TRACONCE1Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class Partial Public Class TRACONCO1Type #Region "Private fields" Private _namCO17 As String Private _strAndNumCO122 As String Private _posCodCO123 As String Private _citCO124 As String Private _couCO125 As String Private _nADLNGCO As String Private _tINCO159 As String Private Shared _serializerXml As XmlSerializer #End Region Public Property NamCO17() As String Get Return Me._namCO17 End Get Set Me._namCO17 = Value End Set End Property Public Property StrAndNumCO122() As String Get Return Me._strAndNumCO122 End Get Set Me._strAndNumCO122 = Value End Set End Property Public Property PosCodCO123() As String Get Return Me._posCodCO123 End Get Set Me._posCodCO123 = Value End Set End Property Public Property CitCO124() As String Get Return Me._citCO124 End Get Set Me._citCO124 = Value End Set End Property Public Property CouCO125() As String Get Return Me._couCO125 End Get Set Me._couCO125 = Value End Set End Property Public Property NADLNGCO() As String Get Return Me._nADLNGCO End Get Set Me._nADLNGCO = Value End Set End Property Public Property TINCO159() As String Get Return Me._tINCO159 End Get Set Me._tINCO159 = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRACONCO1Type)) End If Return _serializerXml End Get End Property ''' ''' Test whether NamCO17 should be serialized ''' Public Overridable Function ShouldSerializeNamCO17() As Boolean Return Not String.IsNullOrEmpty(NamCO17) End Function ''' ''' Test whether StrAndNumCO122 should be serialized ''' Public Overridable Function ShouldSerializeStrAndNumCO122() As Boolean Return Not String.IsNullOrEmpty(StrAndNumCO122) End Function ''' ''' Test whether PosCodCO123 should be serialized ''' Public Overridable Function ShouldSerializePosCodCO123() As Boolean Return Not String.IsNullOrEmpty(PosCodCO123) End Function ''' ''' Test whether CitCO124 should be serialized ''' Public Overridable Function ShouldSerializeCitCO124() As Boolean Return Not String.IsNullOrEmpty(CitCO124) End Function ''' ''' Test whether CouCO125 should be serialized ''' Public Overridable Function ShouldSerializeCouCO125() As Boolean Return Not String.IsNullOrEmpty(CouCO125) End Function ''' ''' Test whether NADLNGCO should be serialized ''' Public Overridable Function ShouldSerializeNADLNGCO() As Boolean Return Not String.IsNullOrEmpty(NADLNGCO) End Function ''' ''' Test whether TINCO159 should be serialized ''' Public Overridable Function ShouldSerializeTINCO159() As Boolean Return Not String.IsNullOrEmpty(TINCO159) End Function #Region "Serialize/Deserialize" ''' ''' Serialize TRACONCO1Type object ''' ''' XML value Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream, encoding) 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 Public Overridable Overloads Function Serialize() As String Return Serialize(System.Text.Encoding.UTF8) End Function ''' ''' Deserializes TRACONCO1Type object ''' ''' string to deserialize ''' Output TRACONCO1Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCO1Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TRACONCO1Type) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCO1Type) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As TRACONCO1Type Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRACONCO1Type) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRACONCO1Type Return CType(SerializerXml.Deserialize(s), TRACONCO1Type) End Function #End Region ''' ''' Serializes current TRACONCO1Type 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, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) SaveToFile(fileName, System.Text.Encoding.UTF8) End Sub Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize(encoding) streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an TRACONCO1Type object ''' ''' File to load and deserialize ''' Output TRACONCO1Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As TRACONCO1Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TRACONCO1Type) Try obj = LoadFromFile(fileName, encoding) 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 TRACONCO1Type, ByRef exception As System.Exception) As Boolean Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCO1Type) 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 TRACONCO1Type Return LoadFromFile(fileName, System.Text.Encoding.UTF8) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As TRACONCO1Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) 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 Class End Namespace #Enable Warning