'' ------------------------------------------------------------------------------ '' '' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com '' {"TargetFramework":"Net47","NameSpace":"VersandanmeldungNCTSDE_004","Language":"VisualBasic","ExcludeImportedTypes":true,"ExpandNestedAttributeGroup":true,"GenerateUnusedComplexType":true,"GenerateUnusedSimpleType":true,"Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{"Formating":true,"NewLineOnAttributes":true},"JsonOutput":{},"Enabled":true},"Miscellaneous":{}} '' '' ------------------------------------------------------------------------------ #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 VersandanmeldungNCTSDE_004 Partial Public Class VersandanmeldungVATayp Inherits DatenaustauschNCTSTyp #Region "Private fields" Private _einzelVersandanmeldung As EinzelVersandanmeldungTyp Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._einzelVersandanmeldung = New EinzelVersandanmeldungTyp() End Sub Public Property EinzelVersandanmeldung() As EinzelVersandanmeldungTyp Get Return Me._einzelVersandanmeldung End Get Set Me._einzelVersandanmeldung = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(VersandanmeldungVATayp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize VersandanmeldungVATayp object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes VersandanmeldungVATayp object ''' ''' string to deserialize ''' Output VersandanmeldungVATayp 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 VersandanmeldungVATayp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, VersandanmeldungVATayp) 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 VersandanmeldungVATayp) 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 VersandanmeldungVATayp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), VersandanmeldungVATayp) 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 VersandanmeldungVATayp Return CType(SerializerXml.Deserialize(s), VersandanmeldungVATayp) End Function #End Region ''' ''' Serializes current VersandanmeldungVATayp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 VersandanmeldungVATayp object ''' ''' File to load and deserialize ''' Output VersandanmeldungVATayp 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, ByRef obj As VersandanmeldungVATayp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, VersandanmeldungVATayp) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As VersandanmeldungVATayp) 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 VersandanmeldungVATayp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 EinzelVersandanmeldungTyp #Region "Private fields" Private _objektIdentifizierung As ObjektIdentifizierungVATyp Private _transitOperation As TransitOperationType Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._transitOperation = New TransitOperationType() Me._objektIdentifizierung = New ObjektIdentifizierungVATyp() End Sub Public Property ObjektIdentifizierung() As ObjektIdentifizierungVATyp Get Return Me._objektIdentifizierung End Get Set Me._objektIdentifizierung = Value End Set End Property Public Property TransitOperation() As TransitOperationType Get Return Me._transitOperation End Get Set Me._transitOperation = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(EinzelVersandanmeldungTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize EinzelVersandanmeldungTyp object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes EinzelVersandanmeldungTyp object ''' ''' string to deserialize ''' Output EinzelVersandanmeldungTyp 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 EinzelVersandanmeldungTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, EinzelVersandanmeldungTyp) 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 EinzelVersandanmeldungTyp) 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 EinzelVersandanmeldungTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), EinzelVersandanmeldungTyp) 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 EinzelVersandanmeldungTyp Return CType(SerializerXml.Deserialize(s), EinzelVersandanmeldungTyp) End Function #End Region ''' ''' Serializes current EinzelVersandanmeldungTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 EinzelVersandanmeldungTyp object ''' ''' File to load and deserialize ''' Output EinzelVersandanmeldungTyp 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, ByRef obj As EinzelVersandanmeldungTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, EinzelVersandanmeldungTyp) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As EinzelVersandanmeldungTyp) 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 EinzelVersandanmeldungTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 ObjektIdentifizierungVATyp #Region "Private fields" Private _objektName As String Private _objektAliasname As String Private _bezugsnummerVorblendung As String Private _userVorblendung As String Private _kopieVon As String Private _objektAktion As List(Of String) Private _compliancePruefung As String Private _bearbeiter As String Private _anfBemerkungStatusanzeige As String Private _nameAbsendendesSystem As String Private _shipmentReferenz As String Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._objektAktion = New List(Of String)() End Sub Public Property ObjektName() As String Get Return Me._objektName End Get Set Me._objektName = Value End Set End Property Public Property ObjektAliasname() As String Get Return Me._objektAliasname End Get Set Me._objektAliasname = Value End Set End Property Public Property BezugsnummerVorblendung() As String Get Return Me._bezugsnummerVorblendung End Get Set Me._bezugsnummerVorblendung = Value End Set End Property Public Property UserVorblendung() As String Get Return Me._userVorblendung End Get Set Me._userVorblendung = Value End Set End Property Public Property KopieVon() As String Get Return Me._kopieVon End Get Set Me._kopieVon = Value End Set End Property Public Property ObjektAktion() As List(Of String) Get Return Me._objektAktion End Get Set Me._objektAktion = Value End Set End Property Public Property CompliancePruefung() As String Get Return Me._compliancePruefung End Get Set Me._compliancePruefung = Value End Set End Property Public Property Bearbeiter() As String Get Return Me._bearbeiter End Get Set Me._bearbeiter = Value End Set End Property Public Property AnfBemerkungStatusanzeige() As String Get Return Me._anfBemerkungStatusanzeige End Get Set Me._anfBemerkungStatusanzeige = Value End Set End Property Public Property NameAbsendendesSystem() As String Get Return Me._nameAbsendendesSystem End Get Set Me._nameAbsendendesSystem = Value End Set End Property Public Property ShipmentReferenz() As String Get Return Me._shipmentReferenz End Get Set Me._shipmentReferenz = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ObjektIdentifizierungVATyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ObjektIdentifizierungVATyp object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes ObjektIdentifizierungVATyp object ''' ''' string to deserialize ''' Output ObjektIdentifizierungVATyp 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 ObjektIdentifizierungVATyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ObjektIdentifizierungVATyp) 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 ObjektIdentifizierungVATyp) 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 ObjektIdentifizierungVATyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ObjektIdentifizierungVATyp) 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 ObjektIdentifizierungVATyp Return CType(SerializerXml.Deserialize(s), ObjektIdentifizierungVATyp) End Function #End Region ''' ''' Serializes current ObjektIdentifizierungVATyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 ObjektIdentifizierungVATyp object ''' ''' File to load and deserialize ''' Output ObjektIdentifizierungVATyp 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, ByRef obj As ObjektIdentifizierungVATyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ObjektIdentifizierungVATyp) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ObjektIdentifizierungVATyp) 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 ObjektIdentifizierungVATyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 AdditionalInformationPositionVAType #Region "Private fields" Private _code As String Private _text As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Code() As String Get Return Me._code End Get Set Me._code = Value End Set End Property Public Property Text() As String Get Return Me._text End Get Set Me._text = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AdditionalInformationPositionVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AdditionalInformationPositionVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes AdditionalInformationPositionVAType object ''' ''' string to deserialize ''' Output AdditionalInformationPositionVAType 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 AdditionalInformationPositionVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalInformationPositionVAType) 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 AdditionalInformationPositionVAType) 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 AdditionalInformationPositionVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdditionalInformationPositionVAType) 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 AdditionalInformationPositionVAType Return CType(SerializerXml.Deserialize(s), AdditionalInformationPositionVAType) End Function #End Region ''' ''' Serializes current AdditionalInformationPositionVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 AdditionalInformationPositionVAType object ''' ''' File to load and deserialize ''' Output AdditionalInformationPositionVAType 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, ByRef obj As AdditionalInformationPositionVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalInformationPositionVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As AdditionalInformationPositionVAType) 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 AdditionalInformationPositionVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 AdditionalReferencePositionVAType #Region "Private fields" Private _type As String Private _referenceNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Type() As String Get Return Me._type End Get Set Me._type = Value End Set End Property Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set Me._referenceNumber = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AdditionalReferencePositionVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AdditionalReferencePositionVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes AdditionalReferencePositionVAType object ''' ''' string to deserialize ''' Output AdditionalReferencePositionVAType 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 AdditionalReferencePositionVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalReferencePositionVAType) 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 AdditionalReferencePositionVAType) 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 AdditionalReferencePositionVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdditionalReferencePositionVAType) 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 AdditionalReferencePositionVAType Return CType(SerializerXml.Deserialize(s), AdditionalReferencePositionVAType) End Function #End Region ''' ''' Serializes current AdditionalReferencePositionVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 AdditionalReferencePositionVAType object ''' ''' File to load and deserialize ''' Output AdditionalReferencePositionVAType 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, ByRef obj As AdditionalReferencePositionVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalReferencePositionVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As AdditionalReferencePositionVAType) 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 AdditionalReferencePositionVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 SupportingDocumentPositionVAType #Region "Private fields" Private _type As String Private _referenceNumber As String Private _complementOfInformation As String Private _documentLineItemNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Type() As String Get Return Me._type End Get Set Me._type = Value End Set End Property Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set Me._referenceNumber = Value End Set End Property Public Property ComplementOfInformation() As String Get Return Me._complementOfInformation End Get Set Me._complementOfInformation = Value End Set End Property Public Property DocumentLineItemNumber() As String Get Return Me._documentLineItemNumber End Get Set Me._documentLineItemNumber = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SupportingDocumentPositionVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize SupportingDocumentPositionVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes SupportingDocumentPositionVAType object ''' ''' string to deserialize ''' Output SupportingDocumentPositionVAType 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 SupportingDocumentPositionVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SupportingDocumentPositionVAType) 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 SupportingDocumentPositionVAType) 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 SupportingDocumentPositionVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SupportingDocumentPositionVAType) 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 SupportingDocumentPositionVAType Return CType(SerializerXml.Deserialize(s), SupportingDocumentPositionVAType) End Function #End Region ''' ''' Serializes current SupportingDocumentPositionVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 SupportingDocumentPositionVAType object ''' ''' File to load and deserialize ''' Output SupportingDocumentPositionVAType 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, ByRef obj As SupportingDocumentPositionVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SupportingDocumentPositionVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SupportingDocumentPositionVAType) 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 SupportingDocumentPositionVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 ProcedureTransferenceItemVAType #Region "Private fields" Private _numberOfPackages As String Private _registrationNumber As String Private _goodsItemNumber As String Private _articleCode As String Private _owner As String Private _chargeNumber As String Private _countryOfOrigin As String Private _identificationNumberOfCustodian As String Private _typeOfIdentificationByKey As String Private _referenceNumberOfIdentificationByKey As String Private _commodityCode As String Private _accessViaATLAS As String Private _usualTreatment As String Private _complement As String Private _qualifierOfGoodsReduction As String Private _measurementUnitOfGoodsReduction As String Private _quantityOfGoodsReduction As String Private _qualifierOfGoodsReductionAfterTreatment As String Private _measurementUnitOfGoodsReductionAfterTreatment As String Private _quantityOfGoodsReductionAfterTreatment As String Private _goodsRelatedData As String Private Shared _serializerXml As XmlSerializer #End Region Public Property NumberOfPackages() As String Get Return Me._numberOfPackages End Get Set Me._numberOfPackages = Value End Set End Property Public Property RegistrationNumber() As String Get Return Me._registrationNumber End Get Set Me._registrationNumber = Value End Set End Property Public Property GoodsItemNumber() As String Get Return Me._goodsItemNumber End Get Set Me._goodsItemNumber = Value End Set End Property Public Property ArticleCode() As String Get Return Me._articleCode End Get Set Me._articleCode = Value End Set End Property Public Property Owner() As String Get Return Me._owner End Get Set Me._owner = Value End Set End Property Public Property ChargeNumber() As String Get Return Me._chargeNumber End Get Set Me._chargeNumber = Value End Set End Property Public Property CountryOfOrigin() As String Get Return Me._countryOfOrigin End Get Set Me._countryOfOrigin = Value End Set End Property Public Property IdentificationNumberOfCustodian() As String Get Return Me._identificationNumberOfCustodian End Get Set Me._identificationNumberOfCustodian = Value End Set End Property Public Property TypeOfIdentificationByKey() As String Get Return Me._typeOfIdentificationByKey End Get Set Me._typeOfIdentificationByKey = Value End Set End Property Public Property ReferenceNumberOfIdentificationByKey() As String Get Return Me._referenceNumberOfIdentificationByKey End Get Set Me._referenceNumberOfIdentificationByKey = Value End Set End Property Public Property CommodityCode() As String Get Return Me._commodityCode End Get Set Me._commodityCode = Value End Set End Property Public Property AccessViaATLAS() As String Get Return Me._accessViaATLAS End Get Set Me._accessViaATLAS = Value End Set End Property Public Property UsualTreatment() As String Get Return Me._usualTreatment End Get Set Me._usualTreatment = Value End Set End Property Public Property Complement() As String Get Return Me._complement End Get Set Me._complement = Value End Set End Property Public Property QualifierOfGoodsReduction() As String Get Return Me._qualifierOfGoodsReduction End Get Set Me._qualifierOfGoodsReduction = Value End Set End Property Public Property MeasurementUnitOfGoodsReduction() As String Get Return Me._measurementUnitOfGoodsReduction End Get Set Me._measurementUnitOfGoodsReduction = Value End Set End Property Public Property QuantityOfGoodsReduction() As String Get Return Me._quantityOfGoodsReduction End Get Set Me._quantityOfGoodsReduction = Value End Set End Property Public Property QualifierOfGoodsReductionAfterTreatment() As String Get Return Me._qualifierOfGoodsReductionAfterTreatment End Get Set Me._qualifierOfGoodsReductionAfterTreatment = Value End Set End Property Public Property MeasurementUnitOfGoodsReductionAfterTreatment() As String Get Return Me._measurementUnitOfGoodsReductionAfterTreatment End Get Set Me._measurementUnitOfGoodsReductionAfterTreatment = Value End Set End Property Public Property QuantityOfGoodsReductionAfterTreatment() As String Get Return Me._quantityOfGoodsReductionAfterTreatment End Get Set Me._quantityOfGoodsReductionAfterTreatment = Value End Set End Property Public Property GoodsRelatedData() As String Get Return Me._goodsRelatedData End Get Set Me._goodsRelatedData = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ProcedureTransferenceItemVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ProcedureTransferenceItemVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes ProcedureTransferenceItemVAType object ''' ''' string to deserialize ''' Output ProcedureTransferenceItemVAType 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 ProcedureTransferenceItemVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ProcedureTransferenceItemVAType) 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 ProcedureTransferenceItemVAType) 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 ProcedureTransferenceItemVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ProcedureTransferenceItemVAType) 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 ProcedureTransferenceItemVAType Return CType(SerializerXml.Deserialize(s), ProcedureTransferenceItemVAType) End Function #End Region ''' ''' Serializes current ProcedureTransferenceItemVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 ProcedureTransferenceItemVAType object ''' ''' File to load and deserialize ''' Output ProcedureTransferenceItemVAType 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, ByRef obj As ProcedureTransferenceItemVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ProcedureTransferenceItemVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ProcedureTransferenceItemVAType) 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 ProcedureTransferenceItemVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 ProcedureTransferenceVAType #Region "Private fields" Private _identificationType As String Private _lRN As String Private _typeOfAuthorisation As String Private _referenceNumberOfAuthorisation As String Private _simplyGrantedAuthorisation As String Private _customsOfficeOfSupervision As String Private _procedureTransferenceItem As List(Of ProcedureTransferenceItemVAType) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._procedureTransferenceItem = New List(Of ProcedureTransferenceItemVAType)() End Sub Public Property IdentificationType() As String Get Return Me._identificationType End Get Set Me._identificationType = Value End Set End Property Public Property LRN() As String Get Return Me._lRN End Get Set Me._lRN = Value End Set End Property Public Property TypeOfAuthorisation() As String Get Return Me._typeOfAuthorisation End Get Set Me._typeOfAuthorisation = Value End Set End Property Public Property ReferenceNumberOfAuthorisation() As String Get Return Me._referenceNumberOfAuthorisation End Get Set Me._referenceNumberOfAuthorisation = Value End Set End Property Public Property SimplyGrantedAuthorisation() As String Get Return Me._simplyGrantedAuthorisation End Get Set Me._simplyGrantedAuthorisation = Value End Set End Property Public Property CustomsOfficeOfSupervision() As String Get Return Me._customsOfficeOfSupervision End Get Set Me._customsOfficeOfSupervision = Value End Set End Property Public Property ProcedureTransferenceItem() As List(Of ProcedureTransferenceItemVAType) Get Return Me._procedureTransferenceItem End Get Set Me._procedureTransferenceItem = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ProcedureTransferenceVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ProcedureTransferenceVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes ProcedureTransferenceVAType object ''' ''' string to deserialize ''' Output ProcedureTransferenceVAType 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 ProcedureTransferenceVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ProcedureTransferenceVAType) 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 ProcedureTransferenceVAType) 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 ProcedureTransferenceVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ProcedureTransferenceVAType) 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 ProcedureTransferenceVAType Return CType(SerializerXml.Deserialize(s), ProcedureTransferenceVAType) End Function #End Region ''' ''' Serializes current ProcedureTransferenceVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 ProcedureTransferenceVAType object ''' ''' File to load and deserialize ''' Output ProcedureTransferenceVAType 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, ByRef obj As ProcedureTransferenceVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ProcedureTransferenceVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ProcedureTransferenceVAType) 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 ProcedureTransferenceVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 PreviousDocumentsPositionVAType #Region "Private fields" Private _referenceNumber As String Private _complementOfInformation As String Private _goodsItemNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set Me._referenceNumber = Value End Set End Property Public Property ComplementOfInformation() As String Get Return Me._complementOfInformation End Get Set Me._complementOfInformation = Value End Set End Property Public Property GoodsItemNumber() As String Get Return Me._goodsItemNumber End Get Set Me._goodsItemNumber = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PreviousDocumentsPositionVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize PreviousDocumentsPositionVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes PreviousDocumentsPositionVAType object ''' ''' string to deserialize ''' Output PreviousDocumentsPositionVAType 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 PreviousDocumentsPositionVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PreviousDocumentsPositionVAType) 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 PreviousDocumentsPositionVAType) 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 PreviousDocumentsPositionVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PreviousDocumentsPositionVAType) 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 PreviousDocumentsPositionVAType Return CType(SerializerXml.Deserialize(s), PreviousDocumentsPositionVAType) End Function #End Region ''' ''' Serializes current PreviousDocumentsPositionVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 PreviousDocumentsPositionVAType object ''' ''' File to load and deserialize ''' Output PreviousDocumentsPositionVAType 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, ByRef obj As PreviousDocumentsPositionVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PreviousDocumentsPositionVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PreviousDocumentsPositionVAType) 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 PreviousDocumentsPositionVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 PreviousDocumentPositionVAType #Region "Private fields" Private _type As String Private _previousDocumentDetails As PreviousDocumentsPositionVAType Private _procedureTransference As ProcedureTransferenceVAType Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._procedureTransference = New ProcedureTransferenceVAType() Me._previousDocumentDetails = New PreviousDocumentsPositionVAType() End Sub Public Property Type() As String Get Return Me._type End Get Set Me._type = Value End Set End Property Public Property PreviousDocumentDetails() As PreviousDocumentsPositionVAType Get Return Me._previousDocumentDetails End Get Set Me._previousDocumentDetails = Value End Set End Property Public Property ProcedureTransference() As ProcedureTransferenceVAType Get Return Me._procedureTransference End Get Set Me._procedureTransference = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PreviousDocumentPositionVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize PreviousDocumentPositionVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes PreviousDocumentPositionVAType object ''' ''' string to deserialize ''' Output PreviousDocumentPositionVAType 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 PreviousDocumentPositionVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PreviousDocumentPositionVAType) 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 PreviousDocumentPositionVAType) 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 PreviousDocumentPositionVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PreviousDocumentPositionVAType) 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 PreviousDocumentPositionVAType Return CType(SerializerXml.Deserialize(s), PreviousDocumentPositionVAType) End Function #End Region ''' ''' Serializes current PreviousDocumentPositionVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 PreviousDocumentPositionVAType object ''' ''' File to load and deserialize ''' Output PreviousDocumentPositionVAType 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, ByRef obj As PreviousDocumentPositionVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PreviousDocumentPositionVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PreviousDocumentPositionVAType) 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 PreviousDocumentPositionVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 PackstueckVATyp #Region "Private fields" Private _numberOfPackages As String Private _typeOfPackages As String Private _shippingMarks As String Private _goodsItemNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property NumberOfPackages() As String Get Return Me._numberOfPackages End Get Set Me._numberOfPackages = Value End Set End Property Public Property TypeOfPackages() As String Get Return Me._typeOfPackages End Get Set Me._typeOfPackages = Value End Set End Property Public Property ShippingMarks() As String Get Return Me._shippingMarks End Get Set Me._shippingMarks = Value End Set End Property Public Property GoodsItemNumber() As String Get Return Me._goodsItemNumber End Get Set Me._goodsItemNumber = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PackstueckVATyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize PackstueckVATyp object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes PackstueckVATyp object ''' ''' string to deserialize ''' Output PackstueckVATyp 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 PackstueckVATyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PackstueckVATyp) 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 PackstueckVATyp) 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 PackstueckVATyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PackstueckVATyp) 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 PackstueckVATyp Return CType(SerializerXml.Deserialize(s), PackstueckVATyp) End Function #End Region ''' ''' Serializes current PackstueckVATyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 PackstueckVATyp object ''' ''' File to load and deserialize ''' Output PackstueckVATyp 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, ByRef obj As PackstueckVATyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PackstueckVATyp) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PackstueckVATyp) 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 PackstueckVATyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 ConsignmentItemVAType #Region "Private fields" Private _goodsItemNumber As String Private _declarationGoodsItemNumber As String Private _commodityCode As String Private _referenceNumberUCR As String Private _methodOfPayment As String Private _uNNumber As List(Of String) Private _declarationType As String Private _articleCode As String Private _descriptionOfGoods As String Private _cusCode As String Private _countryOfDispatch As String Private _countryOfDestination As String Private _grossMass As String Private _netMass As String Private _consignee As AddressVA1Type Private _additionalSupplyChainActor As List(Of AdditionalSupplyChainActorVAType) Private _goodsValue As String Private _currencyOfGoodsValue As String Private _exchangeRate As String Private _exchangeDate As Date Private _currencyExchangeRateType As String Private _fractionOfGoodsValue As String Private _guaranteeAmount As String Private _packaging As List(Of PackstueckVATyp) Private _previousDocument As List(Of PreviousDocumentPositionVAType) Private _supportingDocument As List(Of SupportingDocumentPositionVAType) Private _additionalReference As List(Of AdditionalReferencePositionVAType) Private _additionalInformation As List(Of AdditionalInformationPositionVAType) Private _applicationInternalData As ApplicationInternalDataType Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._applicationInternalData = New ApplicationInternalDataType() Me._additionalInformation = New List(Of AdditionalInformationPositionVAType)() Me._additionalReference = New List(Of AdditionalReferencePositionVAType)() Me._supportingDocument = New List(Of SupportingDocumentPositionVAType)() Me._previousDocument = New List(Of PreviousDocumentPositionVAType)() Me._packaging = New List(Of PackstueckVATyp)() Me._additionalSupplyChainActor = New List(Of AdditionalSupplyChainActorVAType)() Me._consignee = New AddressVA1Type() Me._uNNumber = New List(Of String)() End Sub Public Property GoodsItemNumber() As String Get Return Me._goodsItemNumber End Get Set Me._goodsItemNumber = Value End Set End Property Public Property DeclarationGoodsItemNumber() As String Get Return Me._declarationGoodsItemNumber End Get Set Me._declarationGoodsItemNumber = Value End Set End Property Public Property CommodityCode() As String Get Return Me._commodityCode End Get Set Me._commodityCode = Value End Set End Property Public Property ReferenceNumberUCR() As String Get Return Me._referenceNumberUCR End Get Set Me._referenceNumberUCR = Value End Set End Property Public Property MethodOfPayment() As String Get Return Me._methodOfPayment End Get Set Me._methodOfPayment = Value End Set End Property Public Property UNNumber() As List(Of String) Get Return Me._uNNumber End Get Set Me._uNNumber = Value End Set End Property Public Property DeclarationType() As String Get Return Me._declarationType End Get Set Me._declarationType = Value End Set End Property Public Property ArticleCode() As String Get Return Me._articleCode End Get Set Me._articleCode = Value End Set End Property Public Property DescriptionOfGoods() As String Get Return Me._descriptionOfGoods End Get Set Me._descriptionOfGoods = Value End Set End Property Public Property CusCode() As String Get Return Me._cusCode End Get Set Me._cusCode = Value End Set End Property Public Property CountryOfDispatch() As String Get Return Me._countryOfDispatch End Get Set Me._countryOfDispatch = Value End Set End Property Public Property CountryOfDestination() As String Get Return Me._countryOfDestination End Get Set Me._countryOfDestination = Value End Set End Property Public Property GrossMass() As String Get Return Me._grossMass End Get Set Me._grossMass = Value End Set End Property Public Property NetMass() As String Get Return Me._netMass End Get Set Me._netMass = Value End Set End Property Public Property Consignee() As AddressVA1Type Get Return Me._consignee End Get Set Me._consignee = Value End Set End Property Public Property AdditionalSupplyChainActor() As List(Of AdditionalSupplyChainActorVAType) Get Return Me._additionalSupplyChainActor End Get Set Me._additionalSupplyChainActor = Value End Set End Property Public Property GoodsValue() As String Get Return Me._goodsValue End Get Set Me._goodsValue = Value End Set End Property Public Property CurrencyOfGoodsValue() As String Get Return Me._currencyOfGoodsValue End Get Set Me._currencyOfGoodsValue = Value End Set End Property Public Property ExchangeRate() As String Get Return Me._exchangeRate End Get Set Me._exchangeRate = Value End Set End Property Public Property ExchangeDate() As Date Get Return Me._exchangeDate End Get Set Me._exchangeDate = Value End Set End Property Public Property CurrencyExchangeRateType() As String Get Return Me._currencyExchangeRateType End Get Set Me._currencyExchangeRateType = Value End Set End Property Public Property FractionOfGoodsValue() As String Get Return Me._fractionOfGoodsValue End Get Set Me._fractionOfGoodsValue = Value End Set End Property Public Property GuaranteeAmount() As String Get Return Me._guaranteeAmount End Get Set Me._guaranteeAmount = Value End Set End Property Public Property Packaging() As List(Of PackstueckVATyp) Get Return Me._packaging End Get Set Me._packaging = Value End Set End Property Public Property PreviousDocument() As List(Of PreviousDocumentPositionVAType) Get Return Me._previousDocument End Get Set Me._previousDocument = Value End Set End Property Public Property SupportingDocument() As List(Of SupportingDocumentPositionVAType) Get Return Me._supportingDocument End Get Set Me._supportingDocument = Value End Set End Property Public Property AdditionalReference() As List(Of AdditionalReferencePositionVAType) Get Return Me._additionalReference End Get Set Me._additionalReference = Value End Set End Property Public Property AdditionalInformation() As List(Of AdditionalInformationPositionVAType) Get Return Me._additionalInformation End Get Set Me._additionalInformation = Value End Set End Property Public Property ApplicationInternalData() As ApplicationInternalDataType Get Return Me._applicationInternalData End Get Set Me._applicationInternalData = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ConsignmentItemVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ConsignmentItemVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes ConsignmentItemVAType object ''' ''' string to deserialize ''' Output ConsignmentItemVAType 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 ConsignmentItemVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ConsignmentItemVAType) 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 ConsignmentItemVAType) 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 ConsignmentItemVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ConsignmentItemVAType) 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 ConsignmentItemVAType Return CType(SerializerXml.Deserialize(s), ConsignmentItemVAType) End Function #End Region ''' ''' Serializes current ConsignmentItemVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 ConsignmentItemVAType object ''' ''' File to load and deserialize ''' Output ConsignmentItemVAType 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, ByRef obj As ConsignmentItemVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ConsignmentItemVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ConsignmentItemVAType) 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 ConsignmentItemVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 AddressVA1Type #Region "Private fields" Private _addressCode As String Private _identificationNumber As String Private _subsidiaryNumber As String Private _name As String Private _streetAndNumber As String Private _city As String Private _postcode As String Private _country As String Private _contactPerson As ContactPersonVAType Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._contactPerson = New ContactPersonVAType() End Sub Public Property AddressCode() As String Get Return Me._addressCode End Get Set Me._addressCode = Value End Set End Property Public Property IdentificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = Value End Set End Property Public Property SubsidiaryNumber() As String Get Return Me._subsidiaryNumber End Get Set Me._subsidiaryNumber = Value End Set End Property Public Property Name() As String Get Return Me._name End Get Set Me._name = Value End Set End Property Public Property StreetAndNumber() As String Get Return Me._streetAndNumber End Get Set Me._streetAndNumber = Value End Set End Property Public Property City() As String Get Return Me._city End Get Set Me._city = Value End Set End Property Public Property Postcode() As String Get Return Me._postcode End Get Set Me._postcode = Value End Set End Property Public Property Country() As String Get Return Me._country End Get Set Me._country = Value End Set End Property Public Property ContactPerson() As ContactPersonVAType Get Return Me._contactPerson End Get Set Me._contactPerson = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AddressVA1Type)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AddressVA1Type object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes AddressVA1Type object ''' ''' string to deserialize ''' Output AddressVA1Type 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 AddressVA1Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AddressVA1Type) 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 AddressVA1Type) 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 AddressVA1Type Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AddressVA1Type) 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 AddressVA1Type Return CType(SerializerXml.Deserialize(s), AddressVA1Type) End Function #End Region ''' ''' Serializes current AddressVA1Type object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 AddressVA1Type object ''' ''' File to load and deserialize ''' Output AddressVA1Type 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, ByRef obj As AddressVA1Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AddressVA1Type) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As AddressVA1Type) 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 AddressVA1Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 ContactPersonVAType #Region "Private fields" Private _name As String Private _phoneNumber As String Private _eMailAddress As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Name() As String Get Return Me._name End Get Set Me._name = Value End Set End Property Public Property PhoneNumber() As String Get Return Me._phoneNumber End Get Set Me._phoneNumber = Value End Set End Property Public Property EMailAddress() As String Get Return Me._eMailAddress End Get Set Me._eMailAddress = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ContactPersonVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ContactPersonVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes ContactPersonVAType object ''' ''' string to deserialize ''' Output ContactPersonVAType 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 ContactPersonVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ContactPersonVAType) 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 ContactPersonVAType) 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 ContactPersonVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ContactPersonVAType) 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 ContactPersonVAType Return CType(SerializerXml.Deserialize(s), ContactPersonVAType) End Function #End Region ''' ''' Serializes current ContactPersonVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 ContactPersonVAType object ''' ''' File to load and deserialize ''' Output ContactPersonVAType 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, ByRef obj As ContactPersonVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ContactPersonVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ContactPersonVAType) 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 ContactPersonVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 AdditionalSupplyChainActorVAType #Region "Private fields" Private _role As String Private _identificationNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Role() As String Get Return Me._role End Get Set Me._role = Value End Set End Property Public Property IdentificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AdditionalSupplyChainActorVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AdditionalSupplyChainActorVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes AdditionalSupplyChainActorVAType object ''' ''' string to deserialize ''' Output AdditionalSupplyChainActorVAType 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 AdditionalSupplyChainActorVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalSupplyChainActorVAType) 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 AdditionalSupplyChainActorVAType) 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 AdditionalSupplyChainActorVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdditionalSupplyChainActorVAType) 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 AdditionalSupplyChainActorVAType Return CType(SerializerXml.Deserialize(s), AdditionalSupplyChainActorVAType) End Function #End Region ''' ''' Serializes current AdditionalSupplyChainActorVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 AdditionalSupplyChainActorVAType object ''' ''' File to load and deserialize ''' Output AdditionalSupplyChainActorVAType 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, ByRef obj As AdditionalSupplyChainActorVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalSupplyChainActorVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As AdditionalSupplyChainActorVAType) 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 AdditionalSupplyChainActorVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 ApplicationInternalDataType #Region "Private fields" Private _additionalDetails As List(Of ApplicationInternalDataAdditionalDetailsDataType) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._additionalDetails = New List(Of ApplicationInternalDataAdditionalDetailsDataType)() End Sub Public Property AdditionalDetails() As List(Of ApplicationInternalDataAdditionalDetailsDataType) Get Return Me._additionalDetails End Get Set Me._additionalDetails = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ApplicationInternalDataType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ApplicationInternalDataType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes ApplicationInternalDataType object ''' ''' string to deserialize ''' Output ApplicationInternalDataType 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 ApplicationInternalDataType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ApplicationInternalDataType) 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 ApplicationInternalDataType) 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 ApplicationInternalDataType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ApplicationInternalDataType) 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 ApplicationInternalDataType Return CType(SerializerXml.Deserialize(s), ApplicationInternalDataType) End Function #End Region ''' ''' Serializes current ApplicationInternalDataType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 ApplicationInternalDataType object ''' ''' File to load and deserialize ''' Output ApplicationInternalDataType 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, ByRef obj As ApplicationInternalDataType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ApplicationInternalDataType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ApplicationInternalDataType) 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 ApplicationInternalDataType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 ApplicationInternalDataAdditionalDetailsDataType #Region "Private fields" Private _key As String Private _value As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Key() As String Get Return Me._key End Get Set Me._key = Value End Set End Property Public Property Value() As String Get Return Me._value End Get Set Me._value = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ApplicationInternalDataAdditionalDetailsDataType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ApplicationInternalDataAdditionalDetailsDataType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes ApplicationInternalDataAdditionalDetailsDataType object ''' ''' string to deserialize ''' Output ApplicationInternalDataAdditionalDetailsDataType 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 ApplicationInternalDataAdditionalDetailsDataType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ApplicationInternalDataAdditionalDetailsDataType) 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 ApplicationInternalDataAdditionalDetailsDataType) 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 ApplicationInternalDataAdditionalDetailsDataType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ApplicationInternalDataAdditionalDetailsDataType) 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 ApplicationInternalDataAdditionalDetailsDataType Return CType(SerializerXml.Deserialize(s), ApplicationInternalDataAdditionalDetailsDataType) End Function #End Region ''' ''' Serializes current ApplicationInternalDataAdditionalDetailsDataType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 ApplicationInternalDataAdditionalDetailsDataType object ''' ''' File to load and deserialize ''' Output ApplicationInternalDataAdditionalDetailsDataType 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, ByRef obj As ApplicationInternalDataAdditionalDetailsDataType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ApplicationInternalDataAdditionalDetailsDataType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ApplicationInternalDataAdditionalDetailsDataType) 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 ApplicationInternalDataAdditionalDetailsDataType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 AdditionalInformationHouseVAType #Region "Private fields" Private _code As String Private _text As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Code() As String Get Return Me._code End Get Set Me._code = Value End Set End Property Public Property Text() As String Get Return Me._text End Get Set Me._text = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AdditionalInformationHouseVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AdditionalInformationHouseVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes AdditionalInformationHouseVAType object ''' ''' string to deserialize ''' Output AdditionalInformationHouseVAType 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 AdditionalInformationHouseVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalInformationHouseVAType) 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 AdditionalInformationHouseVAType) 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 AdditionalInformationHouseVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdditionalInformationHouseVAType) 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 AdditionalInformationHouseVAType Return CType(SerializerXml.Deserialize(s), AdditionalInformationHouseVAType) End Function #End Region ''' ''' Serializes current AdditionalInformationHouseVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 AdditionalInformationHouseVAType object ''' ''' File to load and deserialize ''' Output AdditionalInformationHouseVAType 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, ByRef obj As AdditionalInformationHouseVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalInformationHouseVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As AdditionalInformationHouseVAType) 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 AdditionalInformationHouseVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 AdditionalReferenceHouseVAType #Region "Private fields" Private _type As String Private _referenceNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Type() As String Get Return Me._type End Get Set Me._type = Value End Set End Property Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set Me._referenceNumber = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AdditionalReferenceHouseVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AdditionalReferenceHouseVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes AdditionalReferenceHouseVAType object ''' ''' string to deserialize ''' Output AdditionalReferenceHouseVAType 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 AdditionalReferenceHouseVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalReferenceHouseVAType) 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 AdditionalReferenceHouseVAType) 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 AdditionalReferenceHouseVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdditionalReferenceHouseVAType) 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 AdditionalReferenceHouseVAType Return CType(SerializerXml.Deserialize(s), AdditionalReferenceHouseVAType) End Function #End Region ''' ''' Serializes current AdditionalReferenceHouseVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 AdditionalReferenceHouseVAType object ''' ''' File to load and deserialize ''' Output AdditionalReferenceHouseVAType 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, ByRef obj As AdditionalReferenceHouseVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalReferenceHouseVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As AdditionalReferenceHouseVAType) 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 AdditionalReferenceHouseVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 TransportDocumentVAHouseType #Region "Private fields" Private _type As String Private _referenceNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Type() As String Get Return Me._type End Get Set Me._type = Value End Set End Property Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set Me._referenceNumber = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransportDocumentVAHouseType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize TransportDocumentVAHouseType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes TransportDocumentVAHouseType object ''' ''' string to deserialize ''' Output TransportDocumentVAHouseType 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 TransportDocumentVAHouseType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransportDocumentVAHouseType) 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 TransportDocumentVAHouseType) 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 TransportDocumentVAHouseType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransportDocumentVAHouseType) 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 TransportDocumentVAHouseType Return CType(SerializerXml.Deserialize(s), TransportDocumentVAHouseType) End Function #End Region ''' ''' Serializes current TransportDocumentVAHouseType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 TransportDocumentVAHouseType object ''' ''' File to load and deserialize ''' Output TransportDocumentVAHouseType 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, ByRef obj As TransportDocumentVAHouseType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransportDocumentVAHouseType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TransportDocumentVAHouseType) 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 TransportDocumentVAHouseType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 SupportingDocumentHouseVAType #Region "Private fields" Private _type As String Private _referenceNumber As String Private _documentLineItemNumber As String Private _complementOfInformation As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Type() As String Get Return Me._type End Get Set Me._type = Value End Set End Property Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set Me._referenceNumber = Value End Set End Property Public Property DocumentLineItemNumber() As String Get Return Me._documentLineItemNumber End Get Set Me._documentLineItemNumber = Value End Set End Property Public Property ComplementOfInformation() As String Get Return Me._complementOfInformation End Get Set Me._complementOfInformation = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SupportingDocumentHouseVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize SupportingDocumentHouseVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes SupportingDocumentHouseVAType object ''' ''' string to deserialize ''' Output SupportingDocumentHouseVAType 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 SupportingDocumentHouseVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SupportingDocumentHouseVAType) 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 SupportingDocumentHouseVAType) 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 SupportingDocumentHouseVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SupportingDocumentHouseVAType) 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 SupportingDocumentHouseVAType Return CType(SerializerXml.Deserialize(s), SupportingDocumentHouseVAType) End Function #End Region ''' ''' Serializes current SupportingDocumentHouseVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 SupportingDocumentHouseVAType object ''' ''' File to load and deserialize ''' Output SupportingDocumentHouseVAType 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, ByRef obj As SupportingDocumentHouseVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SupportingDocumentHouseVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SupportingDocumentHouseVAType) 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 SupportingDocumentHouseVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 HouseConsignmentVAType #Region "Private fields" Private _houseConsignmentReference As String Private _countryOfDispatch As String Private _countryOfDestination As String Private _grossMass As String Private _referenceNumberUCR As String Private _consignor As AddressVA1Type Private _consignee As AddressVA1Type Private _additionalSupplyChainActor As List(Of AdditionalSupplyChainActorVAType) Private _previousDocument As List(Of PreviousDocumentVAType) Private _supportingDocument As List(Of SupportingDocumentHouseVAType) Private _transportDocument As List(Of TransportDocumentVAHouseType) Private _additionalReference As List(Of AdditionalReferenceHouseVAType) Private _additionalInformation As List(Of AdditionalInformationHouseVAType) Private _transportCharges As String Private _applicationInternalData As ApplicationInternalDataType Private _consignmentItem As List(Of ConsignmentItemVAType) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._consignmentItem = New List(Of ConsignmentItemVAType)() Me._applicationInternalData = New ApplicationInternalDataType() Me._additionalInformation = New List(Of AdditionalInformationHouseVAType)() Me._additionalReference = New List(Of AdditionalReferenceHouseVAType)() Me._transportDocument = New List(Of TransportDocumentVAHouseType)() Me._supportingDocument = New List(Of SupportingDocumentHouseVAType)() Me._previousDocument = New List(Of PreviousDocumentVAType)() Me._additionalSupplyChainActor = New List(Of AdditionalSupplyChainActorVAType)() Me._consignee = New AddressVA1Type() Me._consignor = New AddressVA1Type() End Sub Public Property HouseConsignmentReference() As String Get Return Me._houseConsignmentReference End Get Set Me._houseConsignmentReference = Value End Set End Property Public Property CountryOfDispatch() As String Get Return Me._countryOfDispatch End Get Set Me._countryOfDispatch = Value End Set End Property Public Property CountryOfDestination() As String Get Return Me._countryOfDestination End Get Set Me._countryOfDestination = Value End Set End Property Public Property GrossMass() As String Get Return Me._grossMass End Get Set Me._grossMass = Value End Set End Property Public Property ReferenceNumberUCR() As String Get Return Me._referenceNumberUCR End Get Set Me._referenceNumberUCR = Value End Set End Property Public Property Consignor() As AddressVA1Type Get Return Me._consignor End Get Set Me._consignor = Value End Set End Property Public Property Consignee() As AddressVA1Type Get Return Me._consignee End Get Set Me._consignee = Value End Set End Property Public Property AdditionalSupplyChainActor() As List(Of AdditionalSupplyChainActorVAType) Get Return Me._additionalSupplyChainActor End Get Set Me._additionalSupplyChainActor = Value End Set End Property Public Property PreviousDocument() As List(Of PreviousDocumentVAType) Get Return Me._previousDocument End Get Set Me._previousDocument = Value End Set End Property Public Property SupportingDocument() As List(Of SupportingDocumentHouseVAType) Get Return Me._supportingDocument End Get Set Me._supportingDocument = Value End Set End Property Public Property TransportDocument() As List(Of TransportDocumentVAHouseType) Get Return Me._transportDocument End Get Set Me._transportDocument = Value End Set End Property Public Property AdditionalReference() As List(Of AdditionalReferenceHouseVAType) Get Return Me._additionalReference End Get Set Me._additionalReference = Value End Set End Property Public Property AdditionalInformation() As List(Of AdditionalInformationHouseVAType) Get Return Me._additionalInformation End Get Set Me._additionalInformation = Value End Set End Property Public Property TransportCharges() As String Get Return Me._transportCharges End Get Set Me._transportCharges = Value End Set End Property Public Property ApplicationInternalData() As ApplicationInternalDataType Get Return Me._applicationInternalData End Get Set Me._applicationInternalData = Value End Set End Property Public Property ConsignmentItem() As List(Of ConsignmentItemVAType) Get Return Me._consignmentItem End Get Set Me._consignmentItem = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(HouseConsignmentVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize HouseConsignmentVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes HouseConsignmentVAType object ''' ''' string to deserialize ''' Output HouseConsignmentVAType 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 HouseConsignmentVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, HouseConsignmentVAType) 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 HouseConsignmentVAType) 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 HouseConsignmentVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HouseConsignmentVAType) 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 HouseConsignmentVAType Return CType(SerializerXml.Deserialize(s), HouseConsignmentVAType) End Function #End Region ''' ''' Serializes current HouseConsignmentVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 HouseConsignmentVAType object ''' ''' File to load and deserialize ''' Output HouseConsignmentVAType 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, ByRef obj As HouseConsignmentVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, HouseConsignmentVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As HouseConsignmentVAType) 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 HouseConsignmentVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 PreviousDocumentVAType #Region "Private fields" Private _type As String Private _referenceNumber As String Private _complementOfInformation As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Type() As String Get Return Me._type End Get Set Me._type = Value End Set End Property Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set Me._referenceNumber = Value End Set End Property Public Property ComplementOfInformation() As String Get Return Me._complementOfInformation End Get Set Me._complementOfInformation = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PreviousDocumentVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize PreviousDocumentVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes PreviousDocumentVAType object ''' ''' string to deserialize ''' Output PreviousDocumentVAType 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 PreviousDocumentVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PreviousDocumentVAType) 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 PreviousDocumentVAType) 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 PreviousDocumentVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PreviousDocumentVAType) 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 PreviousDocumentVAType Return CType(SerializerXml.Deserialize(s), PreviousDocumentVAType) End Function #End Region ''' ''' Serializes current PreviousDocumentVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 PreviousDocumentVAType object ''' ''' File to load and deserialize ''' Output PreviousDocumentVAType 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, ByRef obj As PreviousDocumentVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PreviousDocumentVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PreviousDocumentVAType) 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 PreviousDocumentVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 AdditionalInformationVAType #Region "Private fields" Private _code As String Private _text As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Code() As String Get Return Me._code End Get Set Me._code = Value End Set End Property Public Property Text() As String Get Return Me._text End Get Set Me._text = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AdditionalInformationVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AdditionalInformationVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes AdditionalInformationVAType object ''' ''' string to deserialize ''' Output AdditionalInformationVAType 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 AdditionalInformationVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalInformationVAType) 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 AdditionalInformationVAType) 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 AdditionalInformationVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdditionalInformationVAType) 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 AdditionalInformationVAType Return CType(SerializerXml.Deserialize(s), AdditionalInformationVAType) End Function #End Region ''' ''' Serializes current AdditionalInformationVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 AdditionalInformationVAType object ''' ''' File to load and deserialize ''' Output AdditionalInformationVAType 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, ByRef obj As AdditionalInformationVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalInformationVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As AdditionalInformationVAType) 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 AdditionalInformationVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 AdditionalReferenceVAType #Region "Private fields" Private _type As String Private _referenceNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Type() As String Get Return Me._type End Get Set Me._type = Value End Set End Property Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set Me._referenceNumber = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AdditionalReferenceVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AdditionalReferenceVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes AdditionalReferenceVAType object ''' ''' string to deserialize ''' Output AdditionalReferenceVAType 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 AdditionalReferenceVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalReferenceVAType) 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 AdditionalReferenceVAType) 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 AdditionalReferenceVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdditionalReferenceVAType) 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 AdditionalReferenceVAType Return CType(SerializerXml.Deserialize(s), AdditionalReferenceVAType) End Function #End Region ''' ''' Serializes current AdditionalReferenceVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 AdditionalReferenceVAType object ''' ''' File to load and deserialize ''' Output AdditionalReferenceVAType 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, ByRef obj As AdditionalReferenceVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalReferenceVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As AdditionalReferenceVAType) 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 AdditionalReferenceVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 TransportDocumentVAType #Region "Private fields" Private _type As String Private _referenceNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Type() As String Get Return Me._type End Get Set Me._type = Value End Set End Property Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set Me._referenceNumber = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransportDocumentVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize TransportDocumentVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes TransportDocumentVAType object ''' ''' string to deserialize ''' Output TransportDocumentVAType 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 TransportDocumentVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransportDocumentVAType) 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 TransportDocumentVAType) 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 TransportDocumentVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransportDocumentVAType) 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 TransportDocumentVAType Return CType(SerializerXml.Deserialize(s), TransportDocumentVAType) End Function #End Region ''' ''' Serializes current TransportDocumentVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 TransportDocumentVAType object ''' ''' File to load and deserialize ''' Output TransportDocumentVAType 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, ByRef obj As TransportDocumentVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransportDocumentVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TransportDocumentVAType) 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 TransportDocumentVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 SupportingDocumentVAType #Region "Private fields" Private _type As String Private _referenceNumber As String Private _documentLineItemNumber As String Private _complementOfInformation As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Type() As String Get Return Me._type End Get Set Me._type = Value End Set End Property Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set Me._referenceNumber = Value End Set End Property Public Property DocumentLineItemNumber() As String Get Return Me._documentLineItemNumber End Get Set Me._documentLineItemNumber = Value End Set End Property Public Property ComplementOfInformation() As String Get Return Me._complementOfInformation End Get Set Me._complementOfInformation = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SupportingDocumentVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize SupportingDocumentVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes SupportingDocumentVAType object ''' ''' string to deserialize ''' Output SupportingDocumentVAType 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 SupportingDocumentVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SupportingDocumentVAType) 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 SupportingDocumentVAType) 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 SupportingDocumentVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SupportingDocumentVAType) 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 SupportingDocumentVAType Return CType(SerializerXml.Deserialize(s), SupportingDocumentVAType) End Function #End Region ''' ''' Serializes current SupportingDocumentVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 SupportingDocumentVAType object ''' ''' File to load and deserialize ''' Output SupportingDocumentVAType 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, ByRef obj As SupportingDocumentVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SupportingDocumentVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SupportingDocumentVAType) 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 SupportingDocumentVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 AddressVAType #Region "Private fields" Private _addressCode As String Private _identificationNumber As String Private _subsidiaryNumber As String Private _contactPerson As ContactPersonVAType Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._contactPerson = New ContactPersonVAType() End Sub Public Property AddressCode() As String Get Return Me._addressCode End Get Set Me._addressCode = Value End Set End Property Public Property IdentificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = Value End Set End Property Public Property SubsidiaryNumber() As String Get Return Me._subsidiaryNumber End Get Set Me._subsidiaryNumber = Value End Set End Property Public Property ContactPerson() As ContactPersonVAType Get Return Me._contactPerson End Get Set Me._contactPerson = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AddressVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AddressVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes AddressVAType object ''' ''' string to deserialize ''' Output AddressVAType 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 AddressVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AddressVAType) 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 AddressVAType) 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 AddressVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AddressVAType) 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 AddressVAType Return CType(SerializerXml.Deserialize(s), AddressVAType) End Function #End Region ''' ''' Serializes current AddressVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 AddressVAType object ''' ''' File to load and deserialize ''' Output AddressVAType 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, ByRef obj As AddressVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AddressVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As AddressVAType) 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 AddressVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 PlaceOfLoadingOrUnloadingVAType #Region "Private fields" Private _location As String Private _country As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Location() As String Get Return Me._location End Get Set Me._location = Value End Set End Property Public Property Country() As String Get Return Me._country End Get Set Me._country = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PlaceOfLoadingOrUnloadingVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize PlaceOfLoadingOrUnloadingVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes PlaceOfLoadingOrUnloadingVAType object ''' ''' string to deserialize ''' Output PlaceOfLoadingOrUnloadingVAType 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 PlaceOfLoadingOrUnloadingVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PlaceOfLoadingOrUnloadingVAType) 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 PlaceOfLoadingOrUnloadingVAType) 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 PlaceOfLoadingOrUnloadingVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PlaceOfLoadingOrUnloadingVAType) 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 PlaceOfLoadingOrUnloadingVAType Return CType(SerializerXml.Deserialize(s), PlaceOfLoadingOrUnloadingVAType) End Function #End Region ''' ''' Serializes current PlaceOfLoadingOrUnloadingVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 PlaceOfLoadingOrUnloadingVAType object ''' ''' File to load and deserialize ''' Output PlaceOfLoadingOrUnloadingVAType 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, ByRef obj As PlaceOfLoadingOrUnloadingVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PlaceOfLoadingOrUnloadingVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PlaceOfLoadingOrUnloadingVAType) 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 PlaceOfLoadingOrUnloadingVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 RepresentativeVAType #Region "Private fields" Private _addressCode As String Private _identificationNumber As String Private _contactPerson As ContactPersonVAType Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._contactPerson = New ContactPersonVAType() End Sub Public Property AddressCode() As String Get Return Me._addressCode End Get Set Me._addressCode = Value End Set End Property Public Property IdentificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = Value End Set End Property Public Property ContactPerson() As ContactPersonVAType Get Return Me._contactPerson End Get Set Me._contactPerson = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(RepresentativeVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize RepresentativeVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes RepresentativeVAType object ''' ''' string to deserialize ''' Output RepresentativeVAType 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 RepresentativeVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, RepresentativeVAType) 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 RepresentativeVAType) 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 RepresentativeVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), RepresentativeVAType) 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 RepresentativeVAType Return CType(SerializerXml.Deserialize(s), RepresentativeVAType) End Function #End Region ''' ''' Serializes current RepresentativeVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 RepresentativeVAType object ''' ''' File to load and deserialize ''' Output RepresentativeVAType 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, ByRef obj As RepresentativeVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, RepresentativeVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As RepresentativeVAType) 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 RepresentativeVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 HolderOfTheTransitProcedureVAType #Region "Private fields" Private _addressCode As String Private _identificationNumber As String Private _tIRHolderIdentificationNumber As String Private _name As String Private _streetAndNumber As String Private _city As String Private _postcode As String Private _country As String Private _contactPerson As ContactPersonVAType Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._contactPerson = New ContactPersonVAType() End Sub Public Property AddressCode() As String Get Return Me._addressCode End Get Set Me._addressCode = Value End Set End Property Public Property IdentificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = Value End Set End Property Public Property TIRHolderIdentificationNumber() As String Get Return Me._tIRHolderIdentificationNumber End Get Set Me._tIRHolderIdentificationNumber = Value End Set End Property Public Property Name() As String Get Return Me._name End Get Set Me._name = Value End Set End Property Public Property StreetAndNumber() As String Get Return Me._streetAndNumber End Get Set Me._streetAndNumber = Value End Set End Property Public Property City() As String Get Return Me._city End Get Set Me._city = Value End Set End Property Public Property Postcode() As String Get Return Me._postcode End Get Set Me._postcode = Value End Set End Property Public Property Country() As String Get Return Me._country End Get Set Me._country = Value End Set End Property Public Property ContactPerson() As ContactPersonVAType Get Return Me._contactPerson End Get Set Me._contactPerson = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(HolderOfTheTransitProcedureVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize HolderOfTheTransitProcedureVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes HolderOfTheTransitProcedureVAType object ''' ''' string to deserialize ''' Output HolderOfTheTransitProcedureVAType 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 HolderOfTheTransitProcedureVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, HolderOfTheTransitProcedureVAType) 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 HolderOfTheTransitProcedureVAType) 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 HolderOfTheTransitProcedureVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HolderOfTheTransitProcedureVAType) 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 HolderOfTheTransitProcedureVAType Return CType(SerializerXml.Deserialize(s), HolderOfTheTransitProcedureVAType) End Function #End Region ''' ''' Serializes current HolderOfTheTransitProcedureVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 HolderOfTheTransitProcedureVAType object ''' ''' File to load and deserialize ''' Output HolderOfTheTransitProcedureVAType 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, ByRef obj As HolderOfTheTransitProcedureVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, HolderOfTheTransitProcedureVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As HolderOfTheTransitProcedureVAType) 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 HolderOfTheTransitProcedureVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 TransitOperationAuthorisationVAType #Region "Private fields" Private _type As String Private _referenceNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Type() As String Get Return Me._type End Get Set Me._type = Value End Set End Property Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set Me._referenceNumber = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransitOperationAuthorisationVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize TransitOperationAuthorisationVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes TransitOperationAuthorisationVAType object ''' ''' string to deserialize ''' Output TransitOperationAuthorisationVAType 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 TransitOperationAuthorisationVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransitOperationAuthorisationVAType) 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 TransitOperationAuthorisationVAType) 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 TransitOperationAuthorisationVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransitOperationAuthorisationVAType) 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 TransitOperationAuthorisationVAType Return CType(SerializerXml.Deserialize(s), TransitOperationAuthorisationVAType) End Function #End Region ''' ''' Serializes current TransitOperationAuthorisationVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 TransitOperationAuthorisationVAType object ''' ''' File to load and deserialize ''' Output TransitOperationAuthorisationVAType 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, ByRef obj As TransitOperationAuthorisationVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransitOperationAuthorisationVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TransitOperationAuthorisationVAType) 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 TransitOperationAuthorisationVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 ActiveBorderTransportMeansVAType #Region "Private fields" Private _typeOfIdentification As String Private _identificationNumber As String Private _nationality As String Private _conveyanceReferenceNumber As String Private _customsOfficeAtBorderDeclared As String Private Shared _serializerXml As XmlSerializer #End Region Public Property TypeOfIdentification() As String Get Return Me._typeOfIdentification End Get Set Me._typeOfIdentification = Value End Set End Property Public Property IdentificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = Value End Set End Property Public Property Nationality() As String Get Return Me._nationality End Get Set Me._nationality = Value End Set End Property Public Property ConveyanceReferenceNumber() As String Get Return Me._conveyanceReferenceNumber End Get Set Me._conveyanceReferenceNumber = Value End Set End Property Public Property CustomsOfficeAtBorderDeclared() As String Get Return Me._customsOfficeAtBorderDeclared End Get Set Me._customsOfficeAtBorderDeclared = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ActiveBorderTransportMeansVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ActiveBorderTransportMeansVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes ActiveBorderTransportMeansVAType object ''' ''' string to deserialize ''' Output ActiveBorderTransportMeansVAType 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 ActiveBorderTransportMeansVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ActiveBorderTransportMeansVAType) 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 ActiveBorderTransportMeansVAType) 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 ActiveBorderTransportMeansVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ActiveBorderTransportMeansVAType) 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 ActiveBorderTransportMeansVAType Return CType(SerializerXml.Deserialize(s), ActiveBorderTransportMeansVAType) End Function #End Region ''' ''' Serializes current ActiveBorderTransportMeansVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 ActiveBorderTransportMeansVAType object ''' ''' File to load and deserialize ''' Output ActiveBorderTransportMeansVAType 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, ByRef obj As ActiveBorderTransportMeansVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ActiveBorderTransportMeansVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ActiveBorderTransportMeansVAType) 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 ActiveBorderTransportMeansVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 DepartureTransportMeansVAType #Region "Private fields" Private _typeOfIdentification As String Private _identificationNumber As String Private _nationality As String Private Shared _serializerXml As XmlSerializer #End Region Public Property TypeOfIdentification() As String Get Return Me._typeOfIdentification End Get Set Me._typeOfIdentification = Value End Set End Property Public Property IdentificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = Value End Set End Property Public Property Nationality() As String Get Return Me._nationality End Get Set Me._nationality = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(DepartureTransportMeansVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize DepartureTransportMeansVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes DepartureTransportMeansVAType object ''' ''' string to deserialize ''' Output DepartureTransportMeansVAType 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 DepartureTransportMeansVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DepartureTransportMeansVAType) 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 DepartureTransportMeansVAType) 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 DepartureTransportMeansVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), DepartureTransportMeansVAType) 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 DepartureTransportMeansVAType Return CType(SerializerXml.Deserialize(s), DepartureTransportMeansVAType) End Function #End Region ''' ''' Serializes current DepartureTransportMeansVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 DepartureTransportMeansVAType object ''' ''' File to load and deserialize ''' Output DepartureTransportMeansVAType 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, ByRef obj As DepartureTransportMeansVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DepartureTransportMeansVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DepartureTransportMeansVAType) 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 DepartureTransportMeansVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 GuaranteeReferenceVAType #Region "Private fields" Private _currency As String Private _amountToBeCovered As String Private _gRN As String Private _accessCode As String Private _accountName As String Private _goodsValue As String Private _currencyOfGoodsValue As String Private _fractionOfGoodsValue As String Private _currencyExchangeRateCustoms As String Private _currencyExchangeRateAccount As String Private _exchangeDateCustoms As Date Private _exchangeDateAccount As Date Private _currencyExchangeRateTypeCustoms As String Private _currencyExchangeRateTypeAccount As String Private _calculateGoodsValueFromGoodsItems As String Private _commentary As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Currency() As String Get Return Me._currency End Get Set Me._currency = Value End Set End Property Public Property AmountToBeCovered() As String Get Return Me._amountToBeCovered End Get Set Me._amountToBeCovered = Value End Set End Property Public Property GRN() As String Get Return Me._gRN End Get Set Me._gRN = Value End Set End Property Public Property AccessCode() As String Get Return Me._accessCode End Get Set Me._accessCode = Value End Set End Property Public Property AccountName() As String Get Return Me._accountName End Get Set Me._accountName = Value End Set End Property Public Property GoodsValue() As String Get Return Me._goodsValue End Get Set Me._goodsValue = Value End Set End Property Public Property CurrencyOfGoodsValue() As String Get Return Me._currencyOfGoodsValue End Get Set Me._currencyOfGoodsValue = Value End Set End Property Public Property FractionOfGoodsValue() As String Get Return Me._fractionOfGoodsValue End Get Set Me._fractionOfGoodsValue = Value End Set End Property Public Property CurrencyExchangeRateCustoms() As String Get Return Me._currencyExchangeRateCustoms End Get Set Me._currencyExchangeRateCustoms = Value End Set End Property Public Property CurrencyExchangeRateAccount() As String Get Return Me._currencyExchangeRateAccount End Get Set Me._currencyExchangeRateAccount = Value End Set End Property Public Property ExchangeDateCustoms() As Date Get Return Me._exchangeDateCustoms End Get Set Me._exchangeDateCustoms = Value End Set End Property Public Property ExchangeDateAccount() As Date Get Return Me._exchangeDateAccount End Get Set Me._exchangeDateAccount = Value End Set End Property Public Property CurrencyExchangeRateTypeCustoms() As String Get Return Me._currencyExchangeRateTypeCustoms End Get Set Me._currencyExchangeRateTypeCustoms = Value End Set End Property Public Property CurrencyExchangeRateTypeAccount() As String Get Return Me._currencyExchangeRateTypeAccount End Get Set Me._currencyExchangeRateTypeAccount = Value End Set End Property Public Property CalculateGoodsValueFromGoodsItems() As String Get Return Me._calculateGoodsValueFromGoodsItems End Get Set Me._calculateGoodsValueFromGoodsItems = Value End Set End Property Public Property Commentary() As String Get Return Me._commentary End Get Set Me._commentary = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(GuaranteeReferenceVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize GuaranteeReferenceVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes GuaranteeReferenceVAType object ''' ''' string to deserialize ''' Output GuaranteeReferenceVAType 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 GuaranteeReferenceVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GuaranteeReferenceVAType) 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 GuaranteeReferenceVAType) 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 GuaranteeReferenceVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), GuaranteeReferenceVAType) 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 GuaranteeReferenceVAType Return CType(SerializerXml.Deserialize(s), GuaranteeReferenceVAType) End Function #End Region ''' ''' Serializes current GuaranteeReferenceVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 GuaranteeReferenceVAType object ''' ''' File to load and deserialize ''' Output GuaranteeReferenceVAType 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, ByRef obj As GuaranteeReferenceVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GuaranteeReferenceVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As GuaranteeReferenceVAType) 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 GuaranteeReferenceVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 GuaranteeVAType #Region "Private fields" Private _guaranteeType As String Private _otherGuaranteeReference As String Private _guaranteeReference As List(Of GuaranteeReferenceVAType) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._guaranteeReference = New List(Of GuaranteeReferenceVAType)() End Sub Public Property GuaranteeType() As String Get Return Me._guaranteeType End Get Set Me._guaranteeType = Value End Set End Property Public Property OtherGuaranteeReference() As String Get Return Me._otherGuaranteeReference End Get Set Me._otherGuaranteeReference = Value End Set End Property Public Property GuaranteeReference() As List(Of GuaranteeReferenceVAType) Get Return Me._guaranteeReference End Get Set Me._guaranteeReference = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(GuaranteeVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize GuaranteeVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes GuaranteeVAType object ''' ''' string to deserialize ''' Output GuaranteeVAType 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 GuaranteeVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GuaranteeVAType) 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 GuaranteeVAType) 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 GuaranteeVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), GuaranteeVAType) 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 GuaranteeVAType Return CType(SerializerXml.Deserialize(s), GuaranteeVAType) End Function #End Region ''' ''' Serializes current GuaranteeVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 GuaranteeVAType object ''' ''' File to load and deserialize ''' Output GuaranteeVAType 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, ByRef obj As GuaranteeVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GuaranteeVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As GuaranteeVAType) 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 GuaranteeVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 TransportEquipmentVAType #Region "Private fields" Private _numberOfSeals As String Private _seal As List(Of String) Private _containerIdentificationNumber As String Private _goodsReference As List(Of String) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._goodsReference = New List(Of String)() Me._seal = New List(Of String)() End Sub Public Property NumberOfSeals() As String Get Return Me._numberOfSeals End Get Set Me._numberOfSeals = Value End Set End Property Public Property Seal() As List(Of String) Get Return Me._seal End Get Set Me._seal = Value End Set End Property Public Property ContainerIdentificationNumber() As String Get Return Me._containerIdentificationNumber End Get Set Me._containerIdentificationNumber = Value End Set End Property Public Property GoodsReference() As List(Of String) Get Return Me._goodsReference End Get Set Me._goodsReference = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransportEquipmentVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize TransportEquipmentVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes TransportEquipmentVAType object ''' ''' string to deserialize ''' Output TransportEquipmentVAType 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 TransportEquipmentVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransportEquipmentVAType) 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 TransportEquipmentVAType) 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 TransportEquipmentVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransportEquipmentVAType) 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 TransportEquipmentVAType Return CType(SerializerXml.Deserialize(s), TransportEquipmentVAType) End Function #End Region ''' ''' Serializes current TransportEquipmentVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 TransportEquipmentVAType object ''' ''' File to load and deserialize ''' Output TransportEquipmentVAType 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, ByRef obj As TransportEquipmentVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransportEquipmentVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TransportEquipmentVAType) 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 TransportEquipmentVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 CustomsOfficeOfTransitDeclaredVAType #Region "Private fields" Private _referenceNumber As String Private _arrivalDateAndTimeEstimated As Date Private Shared _serializerXml As XmlSerializer #End Region Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set Me._referenceNumber = Value End Set End Property Public Property ArrivalDateAndTimeEstimated() As Date Get Return Me._arrivalDateAndTimeEstimated End Get Set Me._arrivalDateAndTimeEstimated = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CustomsOfficeOfTransitDeclaredVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize CustomsOfficeOfTransitDeclaredVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes CustomsOfficeOfTransitDeclaredVAType object ''' ''' string to deserialize ''' Output CustomsOfficeOfTransitDeclaredVAType 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 CustomsOfficeOfTransitDeclaredVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CustomsOfficeOfTransitDeclaredVAType) 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 CustomsOfficeOfTransitDeclaredVAType) 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 CustomsOfficeOfTransitDeclaredVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CustomsOfficeOfTransitDeclaredVAType) 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 CustomsOfficeOfTransitDeclaredVAType Return CType(SerializerXml.Deserialize(s), CustomsOfficeOfTransitDeclaredVAType) End Function #End Region ''' ''' Serializes current CustomsOfficeOfTransitDeclaredVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 CustomsOfficeOfTransitDeclaredVAType object ''' ''' File to load and deserialize ''' Output CustomsOfficeOfTransitDeclaredVAType 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, ByRef obj As CustomsOfficeOfTransitDeclaredVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CustomsOfficeOfTransitDeclaredVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CustomsOfficeOfTransitDeclaredVAType) 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 CustomsOfficeOfTransitDeclaredVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 LocationOfGoodsVAType #Region "Private fields" Private _typeOfLocation As String Private _qualifierOfIdentification As String Private _additionalIdentifier As String Private _contactPerson As ContactPersonVAType Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._contactPerson = New ContactPersonVAType() End Sub Public Property TypeOfLocation() As String Get Return Me._typeOfLocation End Get Set Me._typeOfLocation = Value End Set End Property Public Property QualifierOfIdentification() As String Get Return Me._qualifierOfIdentification End Get Set Me._qualifierOfIdentification = Value End Set End Property Public Property AdditionalIdentifier() As String Get Return Me._additionalIdentifier End Get Set Me._additionalIdentifier = Value End Set End Property Public Property ContactPerson() As ContactPersonVAType Get Return Me._contactPerson End Get Set Me._contactPerson = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(LocationOfGoodsVAType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize LocationOfGoodsVAType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes LocationOfGoodsVAType object ''' ''' string to deserialize ''' Output LocationOfGoodsVAType 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 LocationOfGoodsVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, LocationOfGoodsVAType) 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 LocationOfGoodsVAType) 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 LocationOfGoodsVAType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), LocationOfGoodsVAType) 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 LocationOfGoodsVAType Return CType(SerializerXml.Deserialize(s), LocationOfGoodsVAType) End Function #End Region ''' ''' Serializes current LocationOfGoodsVAType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 LocationOfGoodsVAType object ''' ''' File to load and deserialize ''' Output LocationOfGoodsVAType 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, ByRef obj As LocationOfGoodsVAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, LocationOfGoodsVAType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As LocationOfGoodsVAType) 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 LocationOfGoodsVAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 TransitOperationType #Region "Private fields" Private _countryOfDispatch As String Private _countryOfDestination As String Private _declarationType As String Private _tIRCarnetNumber As String Private _reducedDatasetIndicator As String Private _locationOfGoods As LocationOfGoodsVAType Private _customsOfficeOfTransitDeclared As List(Of CustomsOfficeOfTransitDeclaredVAType) Private _customsOfficeOfDestinationDeclared As String Private _customsOfficeOfDeparture As String Private _customsOfficeOfExitForTransitDeclared As List(Of String) Private _limitDate As Date Private _transitDeclarationType As String Private _grossMass As String Private _transportEquipment As List(Of TransportEquipmentVAType) Private _bindingItinerary As String Private _guarantee As List(Of GuaranteeVAType) Private _containerIndicator As String Private _inlandModeOfTransport As String Private _departureTransportMeans As List(Of DepartureTransportMeansVAType) Private _modeOfTransportAtTheBorder As String Private _activeBorderTransportMeans As List(Of ActiveBorderTransportMeansVAType) Private _authorisation As List(Of TransitOperationAuthorisationVAType) Private _consignor As AddressVA1Type Private _consignee As AddressVA1Type Private _holderOfTheTransitProcedure As HolderOfTheTransitProcedureVAType Private _representative As RepresentativeVAType Private _additionalSupplyChainActor As List(Of AdditionalSupplyChainActorVAType) Private _security As String Private _referenceNumberUCR As String Private _specificCircumstanceIndicator As String Private _placeOfLoading As PlaceOfLoadingOrUnloadingVAType Private _placeOfUnloading As PlaceOfLoadingOrUnloadingVAType Private _transportCharges As String Private _countryOfRoutingOfConsignment As List(Of String) Private _carrier As AddressVAType Private _previousDocument As List(Of PreviousDocumentVAType) Private _supportingDocument As List(Of SupportingDocumentVAType) Private _transportDocument As List(Of TransportDocumentVAType) Private _additionalReference As List(Of AdditionalReferenceVAType) Private _additionalInformation As List(Of AdditionalInformationVAType) Private _aUTOIMPIndicator As String Private _applicationInternalData As ApplicationInternalDataType Private _houseConsignment As List(Of HouseConsignmentVAType) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._houseConsignment = New List(Of HouseConsignmentVAType)() Me._applicationInternalData = New ApplicationInternalDataType() Me._additionalInformation = New List(Of AdditionalInformationVAType)() Me._additionalReference = New List(Of AdditionalReferenceVAType)() Me._transportDocument = New List(Of TransportDocumentVAType)() Me._supportingDocument = New List(Of SupportingDocumentVAType)() Me._previousDocument = New List(Of PreviousDocumentVAType)() Me._carrier = New AddressVAType() Me._countryOfRoutingOfConsignment = New List(Of String)() Me._placeOfUnloading = New PlaceOfLoadingOrUnloadingVAType() Me._placeOfLoading = New PlaceOfLoadingOrUnloadingVAType() Me._additionalSupplyChainActor = New List(Of AdditionalSupplyChainActorVAType)() Me._representative = New RepresentativeVAType() Me._holderOfTheTransitProcedure = New HolderOfTheTransitProcedureVAType() Me._consignee = New AddressVA1Type() Me._consignor = New AddressVA1Type() Me._authorisation = New List(Of TransitOperationAuthorisationVAType)() Me._activeBorderTransportMeans = New List(Of ActiveBorderTransportMeansVAType)() Me._departureTransportMeans = New List(Of DepartureTransportMeansVAType)() Me._guarantee = New List(Of GuaranteeVAType)() Me._transportEquipment = New List(Of TransportEquipmentVAType)() Me._customsOfficeOfExitForTransitDeclared = New List(Of String)() Me._customsOfficeOfTransitDeclared = New List(Of CustomsOfficeOfTransitDeclaredVAType)() Me._locationOfGoods = New LocationOfGoodsVAType() End Sub Public Property CountryOfDispatch() As String Get Return Me._countryOfDispatch End Get Set Me._countryOfDispatch = Value End Set End Property Public Property CountryOfDestination() As String Get Return Me._countryOfDestination End Get Set Me._countryOfDestination = Value End Set End Property Public Property DeclarationType() As String Get Return Me._declarationType End Get Set Me._declarationType = Value End Set End Property Public Property TIRCarnetNumber() As String Get Return Me._tIRCarnetNumber End Get Set Me._tIRCarnetNumber = Value End Set End Property Public Property ReducedDatasetIndicator() As String Get Return Me._reducedDatasetIndicator End Get Set Me._reducedDatasetIndicator = Value End Set End Property Public Property LocationOfGoods() As LocationOfGoodsVAType Get Return Me._locationOfGoods End Get Set Me._locationOfGoods = Value End Set End Property Public Property CustomsOfficeOfTransitDeclared() As List(Of CustomsOfficeOfTransitDeclaredVAType) Get Return Me._customsOfficeOfTransitDeclared End Get Set Me._customsOfficeOfTransitDeclared = Value End Set End Property Public Property CustomsOfficeOfDestinationDeclared() As String Get Return Me._customsOfficeOfDestinationDeclared End Get Set Me._customsOfficeOfDestinationDeclared = Value End Set End Property Public Property CustomsOfficeOfDeparture() As String Get Return Me._customsOfficeOfDeparture End Get Set Me._customsOfficeOfDeparture = Value End Set End Property Public Property CustomsOfficeOfExitForTransitDeclared() As List(Of String) Get Return Me._customsOfficeOfExitForTransitDeclared End Get Set Me._customsOfficeOfExitForTransitDeclared = Value End Set End Property Public Property LimitDate() As Date Get Return Me._limitDate End Get Set Me._limitDate = Value End Set End Property Public Property TransitDeclarationType() As String Get Return Me._transitDeclarationType End Get Set Me._transitDeclarationType = Value End Set End Property Public Property GrossMass() As String Get Return Me._grossMass End Get Set Me._grossMass = Value End Set End Property Public Property TransportEquipment() As List(Of TransportEquipmentVAType) Get Return Me._transportEquipment End Get Set Me._transportEquipment = Value End Set End Property Public Property BindingItinerary() As String Get Return Me._bindingItinerary End Get Set Me._bindingItinerary = Value End Set End Property Public Property Guarantee() As List(Of GuaranteeVAType) Get Return Me._guarantee End Get Set Me._guarantee = Value End Set End Property Public Property ContainerIndicator() As String Get Return Me._containerIndicator End Get Set Me._containerIndicator = Value End Set End Property Public Property InlandModeOfTransport() As String Get Return Me._inlandModeOfTransport End Get Set Me._inlandModeOfTransport = Value End Set End Property Public Property DepartureTransportMeans() As List(Of DepartureTransportMeansVAType) Get Return Me._departureTransportMeans End Get Set Me._departureTransportMeans = Value End Set End Property Public Property ModeOfTransportAtTheBorder() As String Get Return Me._modeOfTransportAtTheBorder End Get Set Me._modeOfTransportAtTheBorder = Value End Set End Property Public Property ActiveBorderTransportMeans() As List(Of ActiveBorderTransportMeansVAType) Get Return Me._activeBorderTransportMeans End Get Set Me._activeBorderTransportMeans = Value End Set End Property Public Property Authorisation() As List(Of TransitOperationAuthorisationVAType) Get Return Me._authorisation End Get Set Me._authorisation = Value End Set End Property Public Property Consignor() As AddressVA1Type Get Return Me._consignor End Get Set Me._consignor = Value End Set End Property Public Property Consignee() As AddressVA1Type Get Return Me._consignee End Get Set Me._consignee = Value End Set End Property Public Property HolderOfTheTransitProcedure() As HolderOfTheTransitProcedureVAType Get Return Me._holderOfTheTransitProcedure End Get Set Me._holderOfTheTransitProcedure = Value End Set End Property Public Property Representative() As RepresentativeVAType Get Return Me._representative End Get Set Me._representative = Value End Set End Property Public Property AdditionalSupplyChainActor() As List(Of AdditionalSupplyChainActorVAType) Get Return Me._additionalSupplyChainActor End Get Set Me._additionalSupplyChainActor = Value End Set End Property Public Property Security() As String Get Return Me._security End Get Set Me._security = Value End Set End Property Public Property ReferenceNumberUCR() As String Get Return Me._referenceNumberUCR End Get Set Me._referenceNumberUCR = Value End Set End Property Public Property SpecificCircumstanceIndicator() As String Get Return Me._specificCircumstanceIndicator End Get Set Me._specificCircumstanceIndicator = Value End Set End Property Public Property PlaceOfLoading() As PlaceOfLoadingOrUnloadingVAType Get Return Me._placeOfLoading End Get Set Me._placeOfLoading = Value End Set End Property Public Property PlaceOfUnloading() As PlaceOfLoadingOrUnloadingVAType Get Return Me._placeOfUnloading End Get Set Me._placeOfUnloading = Value End Set End Property Public Property TransportCharges() As String Get Return Me._transportCharges End Get Set Me._transportCharges = Value End Set End Property Public Property CountryOfRoutingOfConsignment() As List(Of String) Get Return Me._countryOfRoutingOfConsignment End Get Set Me._countryOfRoutingOfConsignment = Value End Set End Property Public Property Carrier() As AddressVAType Get Return Me._carrier End Get Set Me._carrier = Value End Set End Property Public Property PreviousDocument() As List(Of PreviousDocumentVAType) Get Return Me._previousDocument End Get Set Me._previousDocument = Value End Set End Property Public Property SupportingDocument() As List(Of SupportingDocumentVAType) Get Return Me._supportingDocument End Get Set Me._supportingDocument = Value End Set End Property Public Property TransportDocument() As List(Of TransportDocumentVAType) Get Return Me._transportDocument End Get Set Me._transportDocument = Value End Set End Property Public Property AdditionalReference() As List(Of AdditionalReferenceVAType) Get Return Me._additionalReference End Get Set Me._additionalReference = Value End Set End Property Public Property AdditionalInformation() As List(Of AdditionalInformationVAType) Get Return Me._additionalInformation End Get Set Me._additionalInformation = Value End Set End Property Public Property AUTOIMPIndicator() As String Get Return Me._aUTOIMPIndicator End Get Set Me._aUTOIMPIndicator = Value End Set End Property Public Property ApplicationInternalData() As ApplicationInternalDataType Get Return Me._applicationInternalData End Get Set Me._applicationInternalData = Value End Set End Property Public Property HouseConsignment() As List(Of HouseConsignmentVAType) Get Return Me._houseConsignment End Get Set Me._houseConsignment = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransitOperationType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize TransitOperationType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes TransitOperationType object ''' ''' string to deserialize ''' Output TransitOperationType 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 TransitOperationType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransitOperationType) 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 TransitOperationType) 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 TransitOperationType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransitOperationType) 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 TransitOperationType Return CType(SerializerXml.Deserialize(s), TransitOperationType) End Function #End Region ''' ''' Serializes current TransitOperationType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 TransitOperationType object ''' ''' File to load and deserialize ''' Output TransitOperationType 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, ByRef obj As TransitOperationType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransitOperationType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TransitOperationType) 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 TransitOperationType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 TransaktionNCTSTyp #Region "Private fields" Private _iOPartner As String Private _iODivision1 As String Private _iODivision2 As String Private _iODivision3 As String Private _iOReferenz As String Private _iODatumZeit As Date Private _version As String Private Shared _serializerXml As XmlSerializer #End Region Public Property IOPartner() As String Get Return Me._iOPartner End Get Set Me._iOPartner = Value End Set End Property Public Property IODivision1() As String Get Return Me._iODivision1 End Get Set Me._iODivision1 = Value End Set End Property Public Property IODivision2() As String Get Return Me._iODivision2 End Get Set Me._iODivision2 = Value End Set End Property Public Property IODivision3() As String Get Return Me._iODivision3 End Get Set Me._iODivision3 = Value End Set End Property Public Property IOReferenz() As String Get Return Me._iOReferenz End Get Set Me._iOReferenz = Value End Set End Property Public Property IODatumZeit() As Date Get Return Me._iODatumZeit End Get Set Me._iODatumZeit = Value End Set End Property Public Property Version() As String Get Return Me._version End Get Set Me._version = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransaktionNCTSTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize TransaktionNCTSTyp object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes TransaktionNCTSTyp object ''' ''' string to deserialize ''' Output TransaktionNCTSTyp 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 TransaktionNCTSTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransaktionNCTSTyp) 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 TransaktionNCTSTyp) 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 TransaktionNCTSTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransaktionNCTSTyp) 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 TransaktionNCTSTyp Return CType(SerializerXml.Deserialize(s), TransaktionNCTSTyp) End Function #End Region ''' ''' Serializes current TransaktionNCTSTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 TransaktionNCTSTyp object ''' ''' File to load and deserialize ''' Output TransaktionNCTSTyp 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, ByRef obj As TransaktionNCTSTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransaktionNCTSTyp) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TransaktionNCTSTyp) 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 TransaktionNCTSTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 DatenaustauschNCTSTyp #Region "Private fields" Private _transaktion As TransaktionNCTSTyp Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._transaktion = New TransaktionNCTSTyp() End Sub Public Property Transaktion() As TransaktionNCTSTyp Get Return Me._transaktion End Get Set Me._transaktion = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(DatenaustauschNCTSTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize DatenaustauschNCTSTyp object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes DatenaustauschNCTSTyp object ''' ''' string to deserialize ''' Output DatenaustauschNCTSTyp 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 DatenaustauschNCTSTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DatenaustauschNCTSTyp) 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 DatenaustauschNCTSTyp) 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 DatenaustauschNCTSTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), DatenaustauschNCTSTyp) 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 DatenaustauschNCTSTyp Return CType(SerializerXml.Deserialize(s), DatenaustauschNCTSTyp) End Function #End Region ''' ''' Serializes current DatenaustauschNCTSTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 DatenaustauschNCTSTyp object ''' ''' File to load and deserialize ''' Output DatenaustauschNCTSTyp 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, ByRef obj As DatenaustauschNCTSTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DatenaustauschNCTSTyp) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DatenaustauschNCTSTyp) 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 DatenaustauschNCTSTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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 ApplicationInternalDataAdditionalDetailsType #Region "Private fields" Private _data As List(Of ApplicationInternalDataAdditionalDetailsDataType) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._data = New List(Of ApplicationInternalDataAdditionalDetailsDataType)() End Sub Public Property Data() As List(Of ApplicationInternalDataAdditionalDetailsDataType) Get Return Me._data End Get Set Me._data = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ApplicationInternalDataAdditionalDetailsType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ApplicationInternalDataAdditionalDetailsType object ''' ''' XML value Public Overridable Function Serialize() 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.Indent = True xmlWriterSettings.IndentChars = " " xmlWriterSettings.NewLineOnAttributes = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes ApplicationInternalDataAdditionalDetailsType object ''' ''' string to deserialize ''' Output ApplicationInternalDataAdditionalDetailsType 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 ApplicationInternalDataAdditionalDetailsType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ApplicationInternalDataAdditionalDetailsType) 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 ApplicationInternalDataAdditionalDetailsType) 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 ApplicationInternalDataAdditionalDetailsType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ApplicationInternalDataAdditionalDetailsType) 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 ApplicationInternalDataAdditionalDetailsType Return CType(SerializerXml.Deserialize(s), ApplicationInternalDataAdditionalDetailsType) End Function #End Region ''' ''' Serializes current ApplicationInternalDataAdditionalDetailsType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText 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 ApplicationInternalDataAdditionalDetailsType object ''' ''' File to load and deserialize ''' Output ApplicationInternalDataAdditionalDetailsType 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, ByRef obj As ApplicationInternalDataAdditionalDetailsType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ApplicationInternalDataAdditionalDetailsType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ApplicationInternalDataAdditionalDetailsType) 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 ApplicationInternalDataAdditionalDetailsType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) 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