'' ------------------------------------------------------------------------------ '' '' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com '' {"TargetFramework":"Net48","NameSpace":"NCTS_P5_CC015C","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{},"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 NCTS_P5_CC015C Partial Public Class description #Region "Private fields" Private _value As String Private Shared _serializerXml As XmlSerializer #End Region 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(description)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize description 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() 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 description object ''' ''' string to deserialize ''' Output description 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 description, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, description) 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 description) 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 description Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), description) 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 description Return CType(SerializerXml.Deserialize(s), description) End Function #End Region ''' ''' Serializes current description 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 description object ''' ''' File to load and deserialize ''' Output description 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 description, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, description) 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 description) 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 description 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 rule #Region "Private fields" Private _name 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 Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(rule)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize rule 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() 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 rule object ''' ''' string to deserialize ''' Output rule 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 rule, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, rule) 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 rule) 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 rule Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), rule) 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 rule Return CType(SerializerXml.Deserialize(s), rule) End Function #End Region ''' ''' Serializes current rule 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 rule object ''' ''' File to load and deserialize ''' Output rule 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 rule, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, rule) 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 rule) 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 rule 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 condition #Region "Private fields" Private _name 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 Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(condition)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize condition 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() 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 condition object ''' ''' string to deserialize ''' Output condition 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 condition, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, condition) 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 condition) 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 condition Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), condition) 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 condition Return CType(SerializerXml.Deserialize(s), condition) End Function #End Region ''' ''' Serializes current condition 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 condition object ''' ''' File to load and deserialize ''' Output condition 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 condition, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, condition) 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 condition) 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 condition 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 codeList #Region "Private fields" Private _name As String Private _type As String Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._type = "technical" End Sub Public Property name() As String Get Return Me._name End Get Set Me._name = Value End Set End Property Public Property type() As String Get Return Me._type End Get Set Me._type = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(codeList)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize codeList 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() 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 codeList object ''' ''' string to deserialize ''' Output codeList 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 codeList, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, codeList) 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 codeList) 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 codeList Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), codeList) 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 codeList Return CType(SerializerXml.Deserialize(s), codeList) End Function #End Region ''' ''' Serializes current codeList 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 codeList object ''' ''' File to load and deserialize ''' Output codeList 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 codeList, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, codeList) 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 codeList) 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 codeList 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 CC015CType #Region "Private fields" Private _messageSender As String Private _messageRecipient As String Private _preparationDateAndTime As Date Private _messageIdentification As String Private _messageType As MessageTypes Private _correlationIdentifier As String Private _transitOperation As TransitOperationType06 Private _authorisation As List(Of AuthorisationType03) Private _customsOfficeOfDeparture As CustomsOfficeOfDepartureType03 Private _customsOfficeOfDestinationDeclared As CustomsOfficeOfDestinationDeclaredType01 Private _customsOfficeOfTransitDeclared As List(Of CustomsOfficeOfTransitDeclaredType04) Private _customsOfficeOfExitForTransitDeclared As List(Of CustomsOfficeOfExitForTransitDeclaredType02) Private _holderOfTheTransitProcedure As HolderOfTheTransitProcedureType14 Private _representative As RepresentativeType05 Private _guarantee As List(Of GuaranteeType02) Private _consignment As ConsignmentType20 Private _phaseID As phaseIDtype Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._consignment = New ConsignmentType20() Me._guarantee = New List(Of GuaranteeType02)() Me._representative = New RepresentativeType05() Me._holderOfTheTransitProcedure = New HolderOfTheTransitProcedureType14() Me._customsOfficeOfExitForTransitDeclared = New List(Of CustomsOfficeOfExitForTransitDeclaredType02)() Me._customsOfficeOfTransitDeclared = New List(Of CustomsOfficeOfTransitDeclaredType04)() Me._customsOfficeOfDestinationDeclared = New CustomsOfficeOfDestinationDeclaredType01() Me._customsOfficeOfDeparture = New CustomsOfficeOfDepartureType03() Me._authorisation = New List(Of AuthorisationType03)() Me._transitOperation = New TransitOperationType06() End Sub Public Property messageSender() As String Get Return Me._messageSender End Get Set Me._messageSender = Value End Set End Property Public Property messageRecipient() As String Get Return Me._messageRecipient End Get Set Me._messageRecipient = Value End Set End Property Public Property preparationDateAndTime() As Date Get Return Me._preparationDateAndTime End Get Set Me._preparationDateAndTime = Value End Set End Property Public Property messageIdentification() As String Get Return Me._messageIdentification End Get Set Me._messageIdentification = Value End Set End Property Public Property messageType() As MessageTypes Get Return Me._messageType End Get Set Me._messageType = Value End Set End Property Public Property correlationIdentifier() As String Get Return Me._correlationIdentifier End Get Set Me._correlationIdentifier = Value End Set End Property Public Property TransitOperation() As TransitOperationType06 Get Return Me._transitOperation End Get Set Me._transitOperation = Value End Set End Property Public Property Authorisation() As List(Of AuthorisationType03) Get Return Me._authorisation End Get Set Me._authorisation = Value End Set End Property Public Property CustomsOfficeOfDeparture() As CustomsOfficeOfDepartureType03 Get Return Me._customsOfficeOfDeparture End Get Set Me._customsOfficeOfDeparture = Value End Set End Property Public Property CustomsOfficeOfDestinationDeclared() As CustomsOfficeOfDestinationDeclaredType01 Get Return Me._customsOfficeOfDestinationDeclared End Get Set Me._customsOfficeOfDestinationDeclared = Value End Set End Property Public Property CustomsOfficeOfTransitDeclared() As List(Of CustomsOfficeOfTransitDeclaredType04) Get Return Me._customsOfficeOfTransitDeclared End Get Set Me._customsOfficeOfTransitDeclared = Value End Set End Property Public Property CustomsOfficeOfExitForTransitDeclared() As List(Of CustomsOfficeOfExitForTransitDeclaredType02) Get Return Me._customsOfficeOfExitForTransitDeclared End Get Set Me._customsOfficeOfExitForTransitDeclared = Value End Set End Property Public Property HolderOfTheTransitProcedure() As HolderOfTheTransitProcedureType14 Get Return Me._holderOfTheTransitProcedure End Get Set Me._holderOfTheTransitProcedure = Value End Set End Property Public Property Representative() As RepresentativeType05 Get Return Me._representative End Get Set Me._representative = Value End Set End Property Public Property Guarantee() As List(Of GuaranteeType02) Get Return Me._guarantee End Get Set Me._guarantee = Value End Set End Property Public Property Consignment() As ConsignmentType20 Get Return Me._consignment End Get Set Me._consignment = Value End Set End Property Public Property PhaseID() As phaseIDtype Get Return Me._phaseID End Get Set Me._phaseID = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CC015CType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize CC015CType 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() 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 CC015CType object ''' ''' string to deserialize ''' Output CC015CType 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 CC015CType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CC015CType) 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 CC015CType) 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 CC015CType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CC015CType) 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 CC015CType Return CType(SerializerXml.Deserialize(s), CC015CType) End Function #End Region ''' ''' Serializes current CC015CType 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 CC015CType object ''' ''' File to load and deserialize ''' Output CC015CType 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 CC015CType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CC015CType) 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 CC015CType) 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 CC015CType 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 Public Enum MessageTypes CC004C CC007C CC009C CC013C CC014C CC015C CC017C CC019C CC022C CC023C CC025C CC026C CC028C CC029C CC034C CC035C CC037C CC040C CC042C CC043C CC044C CC045C CC048C CC051C CC054C CC055C CC056C CC057C CC060C CC140C CC141C CC170C CC182C CC190C CC191C CC224C CC225C CC228C CC229C CC231C CC906C CC917C CC928C CD001C CD002C CD003C CD006C CD010C CD012C CD018C CD024C CD027C CD038C CD049C CD050C CD059C CD063C CD070C CD071C CD078C CD094C CD095C CD114C CD115C CD118C CD142C CD143C CD144C CD145C CD150C CD151C CD152C CD160C CD164C CD165C CD168C CD180C CD181C CD200C CD201C CD203C CD204C CD205C CD209C CD411D CD903D CD906C CD917C CD971C CD974C CD975C End Enum Partial Public Class TransitOperationType06 #Region "Private fields" Private _lRN As String Private _declarationType As String Private _additionalDeclarationType As String Private _tIRCarnetNumber As String Private _presentationOfTheGoodsDateAndTime As Date Private _security As String Private _reducedDatasetIndicator As Flag Private _specificCircumstanceIndicator As String Private _communicationLanguageAtDeparture As String Private _bindingItinerary As Flag Private _limitDate As Date Private Shared _serializerXml As XmlSerializer #End Region Public Property LRN() As String Get Return Me._lRN End Get Set Me._lRN = 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 additionalDeclarationType() As String Get Return Me._additionalDeclarationType End Get Set Me._additionalDeclarationType = 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 presentationOfTheGoodsDateAndTime() As Date Get Return Me._presentationOfTheGoodsDateAndTime End Get Set Me._presentationOfTheGoodsDateAndTime = 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 reducedDatasetIndicator() As Flag Get Return Me._reducedDatasetIndicator End Get Set Me._reducedDatasetIndicator = 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 communicationLanguageAtDeparture() As String Get Return Me._communicationLanguageAtDeparture End Get Set Me._communicationLanguageAtDeparture = Value End Set End Property Public Property bindingItinerary() As Flag Get Return Me._bindingItinerary End Get Set Me._bindingItinerary = Value End Set End Property Public Property limitDate() As Date Get Return Me._limitDate End Get Set Me._limitDate = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransitOperationType06)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize TransitOperationType06 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() 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 TransitOperationType06 object ''' ''' string to deserialize ''' Output TransitOperationType06 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 TransitOperationType06, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransitOperationType06) 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 TransitOperationType06) 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 TransitOperationType06 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransitOperationType06) 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 TransitOperationType06 Return CType(SerializerXml.Deserialize(s), TransitOperationType06) End Function #End Region ''' ''' Serializes current TransitOperationType06 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 TransitOperationType06 object ''' ''' File to load and deserialize ''' Output TransitOperationType06 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 TransitOperationType06, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransitOperationType06) 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 TransitOperationType06) 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 TransitOperationType06 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 Public Enum Flag Item0 Item1 End Enum Partial Public Class AuthorisationType03 #Region "Private fields" Private _sequenceNumber As String Private _type As String Private _referenceNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = Value End Set End Property 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(AuthorisationType03)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AuthorisationType03 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() 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 AuthorisationType03 object ''' ''' string to deserialize ''' Output AuthorisationType03 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 AuthorisationType03, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AuthorisationType03) 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 AuthorisationType03) 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 AuthorisationType03 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AuthorisationType03) 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 AuthorisationType03 Return CType(SerializerXml.Deserialize(s), AuthorisationType03) End Function #End Region ''' ''' Serializes current AuthorisationType03 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 AuthorisationType03 object ''' ''' File to load and deserialize ''' Output AuthorisationType03 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 AuthorisationType03, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AuthorisationType03) 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 AuthorisationType03) 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 AuthorisationType03 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 CustomsOfficeOfDepartureType03 #Region "Private fields" Private _referenceNumber 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 Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CustomsOfficeOfDepartureType03)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize CustomsOfficeOfDepartureType03 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() 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 CustomsOfficeOfDepartureType03 object ''' ''' string to deserialize ''' Output CustomsOfficeOfDepartureType03 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 CustomsOfficeOfDepartureType03, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CustomsOfficeOfDepartureType03) 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 CustomsOfficeOfDepartureType03) 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 CustomsOfficeOfDepartureType03 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CustomsOfficeOfDepartureType03) 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 CustomsOfficeOfDepartureType03 Return CType(SerializerXml.Deserialize(s), CustomsOfficeOfDepartureType03) End Function #End Region ''' ''' Serializes current CustomsOfficeOfDepartureType03 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 CustomsOfficeOfDepartureType03 object ''' ''' File to load and deserialize ''' Output CustomsOfficeOfDepartureType03 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 CustomsOfficeOfDepartureType03, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CustomsOfficeOfDepartureType03) 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 CustomsOfficeOfDepartureType03) 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 CustomsOfficeOfDepartureType03 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 CustomsOfficeOfDestinationDeclaredType01 #Region "Private fields" Private _referenceNumber 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 Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CustomsOfficeOfDestinationDeclaredType01)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize CustomsOfficeOfDestinationDeclaredType01 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() 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 CustomsOfficeOfDestinationDeclaredType01 object ''' ''' string to deserialize ''' Output CustomsOfficeOfDestinationDeclaredType01 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 CustomsOfficeOfDestinationDeclaredType01, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CustomsOfficeOfDestinationDeclaredType01) 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 CustomsOfficeOfDestinationDeclaredType01) 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 CustomsOfficeOfDestinationDeclaredType01 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CustomsOfficeOfDestinationDeclaredType01) 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 CustomsOfficeOfDestinationDeclaredType01 Return CType(SerializerXml.Deserialize(s), CustomsOfficeOfDestinationDeclaredType01) End Function #End Region ''' ''' Serializes current CustomsOfficeOfDestinationDeclaredType01 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 CustomsOfficeOfDestinationDeclaredType01 object ''' ''' File to load and deserialize ''' Output CustomsOfficeOfDestinationDeclaredType01 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 CustomsOfficeOfDestinationDeclaredType01, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CustomsOfficeOfDestinationDeclaredType01) 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 CustomsOfficeOfDestinationDeclaredType01) 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 CustomsOfficeOfDestinationDeclaredType01 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 CustomsOfficeOfTransitDeclaredType04 #Region "Private fields" Private _sequenceNumber As String Private _referenceNumber As String Private _arrivalDateAndTimeEstimated As Date Private Shared _serializerXml As XmlSerializer #End Region Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = 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 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(CustomsOfficeOfTransitDeclaredType04)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize CustomsOfficeOfTransitDeclaredType04 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() 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 CustomsOfficeOfTransitDeclaredType04 object ''' ''' string to deserialize ''' Output CustomsOfficeOfTransitDeclaredType04 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 CustomsOfficeOfTransitDeclaredType04, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CustomsOfficeOfTransitDeclaredType04) 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 CustomsOfficeOfTransitDeclaredType04) 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 CustomsOfficeOfTransitDeclaredType04 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CustomsOfficeOfTransitDeclaredType04) 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 CustomsOfficeOfTransitDeclaredType04 Return CType(SerializerXml.Deserialize(s), CustomsOfficeOfTransitDeclaredType04) End Function #End Region ''' ''' Serializes current CustomsOfficeOfTransitDeclaredType04 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 CustomsOfficeOfTransitDeclaredType04 object ''' ''' File to load and deserialize ''' Output CustomsOfficeOfTransitDeclaredType04 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 CustomsOfficeOfTransitDeclaredType04, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CustomsOfficeOfTransitDeclaredType04) 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 CustomsOfficeOfTransitDeclaredType04) 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 CustomsOfficeOfTransitDeclaredType04 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 CustomsOfficeOfExitForTransitDeclaredType02 #Region "Private fields" Private _sequenceNumber As String Private _referenceNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = 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(CustomsOfficeOfExitForTransitDeclaredType02)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize CustomsOfficeOfExitForTransitDeclaredType02 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() 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 CustomsOfficeOfExitForTransitDeclaredType02 object ''' ''' string to deserialize ''' Output CustomsOfficeOfExitForTransitDeclaredType02 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 CustomsOfficeOfExitForTransitDeclaredType02, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CustomsOfficeOfExitForTransitDeclaredType02) 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 CustomsOfficeOfExitForTransitDeclaredType02) 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 CustomsOfficeOfExitForTransitDeclaredType02 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CustomsOfficeOfExitForTransitDeclaredType02) 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 CustomsOfficeOfExitForTransitDeclaredType02 Return CType(SerializerXml.Deserialize(s), CustomsOfficeOfExitForTransitDeclaredType02) End Function #End Region ''' ''' Serializes current CustomsOfficeOfExitForTransitDeclaredType02 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 CustomsOfficeOfExitForTransitDeclaredType02 object ''' ''' File to load and deserialize ''' Output CustomsOfficeOfExitForTransitDeclaredType02 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 CustomsOfficeOfExitForTransitDeclaredType02, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CustomsOfficeOfExitForTransitDeclaredType02) 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 CustomsOfficeOfExitForTransitDeclaredType02) 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 CustomsOfficeOfExitForTransitDeclaredType02 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 HolderOfTheTransitProcedureType14 #Region "Private fields" Private _identificationNumber As String Private _tIRHolderIdentificationNumber As String Private _name As String Private _address As AddressType17 Private _contactPerson As ContactPersonType05 Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._contactPerson = New ContactPersonType05() Me._address = New AddressType17() End Sub 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 Address() As AddressType17 Get Return Me._address End Get Set Me._address = Value End Set End Property Public Property ContactPerson() As ContactPersonType05 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(HolderOfTheTransitProcedureType14)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize HolderOfTheTransitProcedureType14 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() 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 HolderOfTheTransitProcedureType14 object ''' ''' string to deserialize ''' Output HolderOfTheTransitProcedureType14 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 HolderOfTheTransitProcedureType14, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, HolderOfTheTransitProcedureType14) 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 HolderOfTheTransitProcedureType14) 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 HolderOfTheTransitProcedureType14 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HolderOfTheTransitProcedureType14) 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 HolderOfTheTransitProcedureType14 Return CType(SerializerXml.Deserialize(s), HolderOfTheTransitProcedureType14) End Function #End Region ''' ''' Serializes current HolderOfTheTransitProcedureType14 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 HolderOfTheTransitProcedureType14 object ''' ''' File to load and deserialize ''' Output HolderOfTheTransitProcedureType14 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 HolderOfTheTransitProcedureType14, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, HolderOfTheTransitProcedureType14) 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 HolderOfTheTransitProcedureType14) 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 HolderOfTheTransitProcedureType14 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 AddressType17 #Region "Private fields" Private _streetAndNumber As String Private _postcode As String Private _city As String Private _country As String Private Shared _serializerXml As XmlSerializer #End Region Public Property streetAndNumber() As String Get Return Me._streetAndNumber End Get Set Me._streetAndNumber = 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 city() As String Get Return Me._city End Get Set Me._city = 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(AddressType17)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AddressType17 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() 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 AddressType17 object ''' ''' string to deserialize ''' Output AddressType17 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 AddressType17, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AddressType17) 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 AddressType17) 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 AddressType17 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AddressType17) 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 AddressType17 Return CType(SerializerXml.Deserialize(s), AddressType17) End Function #End Region ''' ''' Serializes current AddressType17 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 AddressType17 object ''' ''' File to load and deserialize ''' Output AddressType17 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 AddressType17, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AddressType17) 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 AddressType17) 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 AddressType17 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 ContactPersonType05 #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(ContactPersonType05)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ContactPersonType05 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() 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 ContactPersonType05 object ''' ''' string to deserialize ''' Output ContactPersonType05 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 ContactPersonType05, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ContactPersonType05) 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 ContactPersonType05) 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 ContactPersonType05 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ContactPersonType05) 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 ContactPersonType05 Return CType(SerializerXml.Deserialize(s), ContactPersonType05) End Function #End Region ''' ''' Serializes current ContactPersonType05 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 ContactPersonType05 object ''' ''' File to load and deserialize ''' Output ContactPersonType05 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 ContactPersonType05, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ContactPersonType05) 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 ContactPersonType05) 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 ContactPersonType05 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 RepresentativeType05 #Region "Private fields" Private _identificationNumber As String Private _status As String Private _contactPerson As ContactPersonType05 Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._contactPerson = New ContactPersonType05() End Sub Public Property identificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = Value End Set End Property Public Property status() As String Get Return Me._status End Get Set Me._status = Value End Set End Property Public Property ContactPerson() As ContactPersonType05 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(RepresentativeType05)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize RepresentativeType05 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() 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 RepresentativeType05 object ''' ''' string to deserialize ''' Output RepresentativeType05 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 RepresentativeType05, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, RepresentativeType05) 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 RepresentativeType05) 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 RepresentativeType05 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), RepresentativeType05) 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 RepresentativeType05 Return CType(SerializerXml.Deserialize(s), RepresentativeType05) End Function #End Region ''' ''' Serializes current RepresentativeType05 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 RepresentativeType05 object ''' ''' File to load and deserialize ''' Output RepresentativeType05 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 RepresentativeType05, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, RepresentativeType05) 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 RepresentativeType05) 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 RepresentativeType05 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 GuaranteeType02 #Region "Private fields" Private _sequenceNumber As String Private _guaranteeType As String Private _otherGuaranteeReference As String Private _guaranteeReference As List(Of GuaranteeReferenceType03) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._guaranteeReference = New List(Of GuaranteeReferenceType03)() End Sub Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = Value End Set End Property 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 GuaranteeReferenceType03) 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(GuaranteeType02)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize GuaranteeType02 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() 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 GuaranteeType02 object ''' ''' string to deserialize ''' Output GuaranteeType02 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 GuaranteeType02, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GuaranteeType02) 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 GuaranteeType02) 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 GuaranteeType02 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), GuaranteeType02) 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 GuaranteeType02 Return CType(SerializerXml.Deserialize(s), GuaranteeType02) End Function #End Region ''' ''' Serializes current GuaranteeType02 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 GuaranteeType02 object ''' ''' File to load and deserialize ''' Output GuaranteeType02 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 GuaranteeType02, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GuaranteeType02) 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 GuaranteeType02) 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 GuaranteeType02 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 GuaranteeReferenceType03 #Region "Private fields" Private _sequenceNumber As String Private _gRN As String Private _accessCode As String Private _amountToBeCovered As Decimal Private _currency As String Private Shared _serializerXml As XmlSerializer #End Region Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = 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 amountToBeCovered() As Decimal Get Return Me._amountToBeCovered End Get Set Me._amountToBeCovered = Value End Set End Property Public Property currency() As String Get Return Me._currency End Get Set Me._currency = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(GuaranteeReferenceType03)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize GuaranteeReferenceType03 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() 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 GuaranteeReferenceType03 object ''' ''' string to deserialize ''' Output GuaranteeReferenceType03 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 GuaranteeReferenceType03, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GuaranteeReferenceType03) 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 GuaranteeReferenceType03) 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 GuaranteeReferenceType03 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), GuaranteeReferenceType03) 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 GuaranteeReferenceType03 Return CType(SerializerXml.Deserialize(s), GuaranteeReferenceType03) End Function #End Region ''' ''' Serializes current GuaranteeReferenceType03 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 GuaranteeReferenceType03 object ''' ''' File to load and deserialize ''' Output GuaranteeReferenceType03 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 GuaranteeReferenceType03, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GuaranteeReferenceType03) 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 GuaranteeReferenceType03) 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 GuaranteeReferenceType03 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 ConsignmentType20 #Region "Private fields" Private _countryOfDispatch As String Private _countryOfDestination As String Private _containerIndicator As Flag Private _inlandModeOfTransport As String Private _modeOfTransportAtTheBorder As String Private _grossMass As Decimal Private _referenceNumberUCR As String Private _carrier As CarrierType04 Private _consignor As ConsignorType07 Private _consignee As ConsigneeType05 Private _additionalSupplyChainActor As List(Of AdditionalSupplyChainActorType) Private _transportEquipment As List(Of TransportEquipmentType06) Private _locationOfGoods As LocationOfGoodsType05 Private _departureTransportMeans As List(Of DepartureTransportMeansType03) Private _countryOfRoutingOfConsignment As List(Of CountryOfRoutingOfConsignmentType01) Private _activeBorderTransportMeans As List(Of ActiveBorderTransportMeansType02) Private _placeOfLoading As PlaceOfLoadingType03 Private _placeOfUnloading As PlaceOfUnloadingType01 Private _previousDocument As List(Of PreviousDocumentType09) Private _supportingDocument As List(Of SupportingDocumentType05) Private _transportDocument As List(Of TransportDocumentType04) Private _additionalReference As List(Of AdditionalReferenceType05) Private _additionalInformation As List(Of AdditionalInformationType03) Private _transportCharges As TransportChargesType Private _houseConsignment As List(Of HouseConsignmentType10) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._houseConsignment = New List(Of HouseConsignmentType10)() Me._transportCharges = New TransportChargesType() Me._additionalInformation = New List(Of AdditionalInformationType03)() Me._additionalReference = New List(Of AdditionalReferenceType05)() Me._transportDocument = New List(Of TransportDocumentType04)() Me._supportingDocument = New List(Of SupportingDocumentType05)() Me._previousDocument = New List(Of PreviousDocumentType09)() Me._placeOfUnloading = New PlaceOfUnloadingType01() Me._placeOfLoading = New PlaceOfLoadingType03() Me._activeBorderTransportMeans = New List(Of ActiveBorderTransportMeansType02)() Me._countryOfRoutingOfConsignment = New List(Of CountryOfRoutingOfConsignmentType01)() Me._departureTransportMeans = New List(Of DepartureTransportMeansType03)() Me._locationOfGoods = New LocationOfGoodsType05() Me._transportEquipment = New List(Of TransportEquipmentType06)() Me._additionalSupplyChainActor = New List(Of AdditionalSupplyChainActorType)() Me._consignee = New ConsigneeType05() Me._consignor = New ConsignorType07() Me._carrier = New CarrierType04() 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 containerIndicator() As Flag 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 modeOfTransportAtTheBorder() As String Get Return Me._modeOfTransportAtTheBorder End Get Set Me._modeOfTransportAtTheBorder = Value End Set End Property Public Property grossMass() As Decimal 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 Carrier() As CarrierType04 Get Return Me._carrier End Get Set Me._carrier = Value End Set End Property Public Property Consignor() As ConsignorType07 Get Return Me._consignor End Get Set Me._consignor = Value End Set End Property Public Property Consignee() As ConsigneeType05 Get Return Me._consignee End Get Set Me._consignee = Value End Set End Property Public Property AdditionalSupplyChainActor() As List(Of AdditionalSupplyChainActorType) Get Return Me._additionalSupplyChainActor End Get Set Me._additionalSupplyChainActor = Value End Set End Property Public Property TransportEquipment() As List(Of TransportEquipmentType06) Get Return Me._transportEquipment End Get Set Me._transportEquipment = Value End Set End Property Public Property LocationOfGoods() As LocationOfGoodsType05 Get Return Me._locationOfGoods End Get Set Me._locationOfGoods = Value End Set End Property Public Property DepartureTransportMeans() As List(Of DepartureTransportMeansType03) Get Return Me._departureTransportMeans End Get Set Me._departureTransportMeans = Value End Set End Property Public Property CountryOfRoutingOfConsignment() As List(Of CountryOfRoutingOfConsignmentType01) Get Return Me._countryOfRoutingOfConsignment End Get Set Me._countryOfRoutingOfConsignment = Value End Set End Property Public Property ActiveBorderTransportMeans() As List(Of ActiveBorderTransportMeansType02) Get Return Me._activeBorderTransportMeans End Get Set Me._activeBorderTransportMeans = Value End Set End Property Public Property PlaceOfLoading() As PlaceOfLoadingType03 Get Return Me._placeOfLoading End Get Set Me._placeOfLoading = Value End Set End Property Public Property PlaceOfUnloading() As PlaceOfUnloadingType01 Get Return Me._placeOfUnloading End Get Set Me._placeOfUnloading = Value End Set End Property Public Property PreviousDocument() As List(Of PreviousDocumentType09) Get Return Me._previousDocument End Get Set Me._previousDocument = Value End Set End Property Public Property SupportingDocument() As List(Of SupportingDocumentType05) Get Return Me._supportingDocument End Get Set Me._supportingDocument = Value End Set End Property Public Property TransportDocument() As List(Of TransportDocumentType04) Get Return Me._transportDocument End Get Set Me._transportDocument = Value End Set End Property Public Property AdditionalReference() As List(Of AdditionalReferenceType05) Get Return Me._additionalReference End Get Set Me._additionalReference = Value End Set End Property Public Property AdditionalInformation() As List(Of AdditionalInformationType03) Get Return Me._additionalInformation End Get Set Me._additionalInformation = Value End Set End Property Public Property TransportCharges() As TransportChargesType Get Return Me._transportCharges End Get Set Me._transportCharges = Value End Set End Property Public Property HouseConsignment() As List(Of HouseConsignmentType10) 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(ConsignmentType20)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ConsignmentType20 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() 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 ConsignmentType20 object ''' ''' string to deserialize ''' Output ConsignmentType20 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 ConsignmentType20, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ConsignmentType20) 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 ConsignmentType20) 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 ConsignmentType20 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ConsignmentType20) 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 ConsignmentType20 Return CType(SerializerXml.Deserialize(s), ConsignmentType20) End Function #End Region ''' ''' Serializes current ConsignmentType20 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 ConsignmentType20 object ''' ''' File to load and deserialize ''' Output ConsignmentType20 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 ConsignmentType20, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ConsignmentType20) 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 ConsignmentType20) 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 ConsignmentType20 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 CarrierType04 #Region "Private fields" Private _identificationNumber As String Private _contactPerson As ContactPersonType05 Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._contactPerson = New ContactPersonType05() End Sub Public Property identificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = Value End Set End Property Public Property ContactPerson() As ContactPersonType05 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(CarrierType04)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize CarrierType04 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() 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 CarrierType04 object ''' ''' string to deserialize ''' Output CarrierType04 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 CarrierType04, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CarrierType04) 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 CarrierType04) 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 CarrierType04 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CarrierType04) 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 CarrierType04 Return CType(SerializerXml.Deserialize(s), CarrierType04) End Function #End Region ''' ''' Serializes current CarrierType04 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 CarrierType04 object ''' ''' File to load and deserialize ''' Output CarrierType04 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 CarrierType04, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CarrierType04) 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 CarrierType04) 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 CarrierType04 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 ConsignorType07 #Region "Private fields" Private _identificationNumber As String Private _name As String Private _address As AddressType17 Private _contactPerson As ContactPersonType05 Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._contactPerson = New ContactPersonType05() Me._address = New AddressType17() End Sub Public Property identificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = 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 Address() As AddressType17 Get Return Me._address End Get Set Me._address = Value End Set End Property Public Property ContactPerson() As ContactPersonType05 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(ConsignorType07)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ConsignorType07 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() 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 ConsignorType07 object ''' ''' string to deserialize ''' Output ConsignorType07 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 ConsignorType07, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ConsignorType07) 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 ConsignorType07) 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 ConsignorType07 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ConsignorType07) 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 ConsignorType07 Return CType(SerializerXml.Deserialize(s), ConsignorType07) End Function #End Region ''' ''' Serializes current ConsignorType07 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 ConsignorType07 object ''' ''' File to load and deserialize ''' Output ConsignorType07 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 ConsignorType07, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ConsignorType07) 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 ConsignorType07) 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 ConsignorType07 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 ConsigneeType05 #Region "Private fields" Private _identificationNumber As String Private _name As String Private _address As AddressType17 Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._address = New AddressType17() End Sub Public Property identificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = 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 Address() As AddressType17 Get Return Me._address End Get Set Me._address = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ConsigneeType05)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ConsigneeType05 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() 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 ConsigneeType05 object ''' ''' string to deserialize ''' Output ConsigneeType05 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 ConsigneeType05, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ConsigneeType05) 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 ConsigneeType05) 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 ConsigneeType05 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ConsigneeType05) 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 ConsigneeType05 Return CType(SerializerXml.Deserialize(s), ConsigneeType05) End Function #End Region ''' ''' Serializes current ConsigneeType05 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 ConsigneeType05 object ''' ''' File to load and deserialize ''' Output ConsigneeType05 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 ConsigneeType05, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ConsigneeType05) 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 ConsigneeType05) 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 ConsigneeType05 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 AdditionalSupplyChainActorType #Region "Private fields" Private _sequenceNumber As String Private _role As String Private _identificationNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = Value End Set End Property 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(AdditionalSupplyChainActorType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AdditionalSupplyChainActorType 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() 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 AdditionalSupplyChainActorType object ''' ''' string to deserialize ''' Output AdditionalSupplyChainActorType 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 AdditionalSupplyChainActorType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalSupplyChainActorType) 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 AdditionalSupplyChainActorType) 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 AdditionalSupplyChainActorType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdditionalSupplyChainActorType) 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 AdditionalSupplyChainActorType Return CType(SerializerXml.Deserialize(s), AdditionalSupplyChainActorType) End Function #End Region ''' ''' Serializes current AdditionalSupplyChainActorType 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 AdditionalSupplyChainActorType object ''' ''' File to load and deserialize ''' Output AdditionalSupplyChainActorType 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 AdditionalSupplyChainActorType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalSupplyChainActorType) 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 AdditionalSupplyChainActorType) 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 AdditionalSupplyChainActorType 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 TransportEquipmentType06 #Region "Private fields" Private _sequenceNumber As String Private _containerIdentificationNumber As String Private _numberOfSeals As String Private _seal As List(Of SealType05) Private _goodsReference As List(Of GoodsReferenceType02) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._goodsReference = New List(Of GoodsReferenceType02)() Me._seal = New List(Of SealType05)() End Sub Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = 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 numberOfSeals() As String Get Return Me._numberOfSeals End Get Set Me._numberOfSeals = Value End Set End Property Public Property Seal() As List(Of SealType05) Get Return Me._seal End Get Set Me._seal = Value End Set End Property Public Property GoodsReference() As List(Of GoodsReferenceType02) 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(TransportEquipmentType06)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize TransportEquipmentType06 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() 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 TransportEquipmentType06 object ''' ''' string to deserialize ''' Output TransportEquipmentType06 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 TransportEquipmentType06, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransportEquipmentType06) 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 TransportEquipmentType06) 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 TransportEquipmentType06 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransportEquipmentType06) 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 TransportEquipmentType06 Return CType(SerializerXml.Deserialize(s), TransportEquipmentType06) End Function #End Region ''' ''' Serializes current TransportEquipmentType06 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 TransportEquipmentType06 object ''' ''' File to load and deserialize ''' Output TransportEquipmentType06 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 TransportEquipmentType06, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransportEquipmentType06) 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 TransportEquipmentType06) 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 TransportEquipmentType06 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 SealType05 #Region "Private fields" Private _sequenceNumber As String Private _identifier As String Private Shared _serializerXml As XmlSerializer #End Region Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = Value End Set End Property Public Property identifier() As String Get Return Me._identifier End Get Set Me._identifier = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SealType05)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize SealType05 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() 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 SealType05 object ''' ''' string to deserialize ''' Output SealType05 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 SealType05, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SealType05) 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 SealType05) 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 SealType05 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SealType05) 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 SealType05 Return CType(SerializerXml.Deserialize(s), SealType05) End Function #End Region ''' ''' Serializes current SealType05 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 SealType05 object ''' ''' File to load and deserialize ''' Output SealType05 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 SealType05, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SealType05) 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 SealType05) 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 SealType05 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 GoodsReferenceType02 #Region "Private fields" Private _sequenceNumber As String Private _declarationGoodsItemNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = Value End Set End Property Public Property declarationGoodsItemNumber() As String Get Return Me._declarationGoodsItemNumber End Get Set Me._declarationGoodsItemNumber = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(GoodsReferenceType02)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize GoodsReferenceType02 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() 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 GoodsReferenceType02 object ''' ''' string to deserialize ''' Output GoodsReferenceType02 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 GoodsReferenceType02, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GoodsReferenceType02) 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 GoodsReferenceType02) 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 GoodsReferenceType02 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), GoodsReferenceType02) 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 GoodsReferenceType02 Return CType(SerializerXml.Deserialize(s), GoodsReferenceType02) End Function #End Region ''' ''' Serializes current GoodsReferenceType02 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 GoodsReferenceType02 object ''' ''' File to load and deserialize ''' Output GoodsReferenceType02 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 GoodsReferenceType02, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GoodsReferenceType02) 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 GoodsReferenceType02) 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 GoodsReferenceType02 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 LocationOfGoodsType05 #Region "Private fields" Private _typeOfLocation As String Private _qualifierOfIdentification As String Private _authorisationNumber As String Private _additionalIdentifier As String Private _uNLocode As String Private _customsOffice As CustomsOfficeType02 Private _gNSS As GNSSType Private _economicOperator As EconomicOperatorType03 Private _address As AddressType14 Private _postcodeAddress As PostcodeAddressType02 Private _contactPerson As ContactPersonType06 Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._contactPerson = New ContactPersonType06() Me._postcodeAddress = New PostcodeAddressType02() Me._address = New AddressType14() Me._economicOperator = New EconomicOperatorType03() Me._gNSS = New GNSSType() Me._customsOffice = New CustomsOfficeType02() 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 authorisationNumber() As String Get Return Me._authorisationNumber End Get Set Me._authorisationNumber = 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 UNLocode() As String Get Return Me._uNLocode End Get Set Me._uNLocode = Value End Set End Property Public Property CustomsOffice() As CustomsOfficeType02 Get Return Me._customsOffice End Get Set Me._customsOffice = Value End Set End Property Public Property GNSS() As GNSSType Get Return Me._gNSS End Get Set Me._gNSS = Value End Set End Property Public Property EconomicOperator() As EconomicOperatorType03 Get Return Me._economicOperator End Get Set Me._economicOperator = Value End Set End Property Public Property Address() As AddressType14 Get Return Me._address End Get Set Me._address = Value End Set End Property Public Property PostcodeAddress() As PostcodeAddressType02 Get Return Me._postcodeAddress End Get Set Me._postcodeAddress = Value End Set End Property Public Property ContactPerson() As ContactPersonType06 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(LocationOfGoodsType05)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize LocationOfGoodsType05 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() 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 LocationOfGoodsType05 object ''' ''' string to deserialize ''' Output LocationOfGoodsType05 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 LocationOfGoodsType05, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, LocationOfGoodsType05) 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 LocationOfGoodsType05) 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 LocationOfGoodsType05 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), LocationOfGoodsType05) 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 LocationOfGoodsType05 Return CType(SerializerXml.Deserialize(s), LocationOfGoodsType05) End Function #End Region ''' ''' Serializes current LocationOfGoodsType05 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 LocationOfGoodsType05 object ''' ''' File to load and deserialize ''' Output LocationOfGoodsType05 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 LocationOfGoodsType05, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, LocationOfGoodsType05) 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 LocationOfGoodsType05) 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 LocationOfGoodsType05 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 CustomsOfficeType02 #Region "Private fields" Private _referenceNumber 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 Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CustomsOfficeType02)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize CustomsOfficeType02 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() 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 CustomsOfficeType02 object ''' ''' string to deserialize ''' Output CustomsOfficeType02 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 CustomsOfficeType02, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CustomsOfficeType02) 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 CustomsOfficeType02) 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 CustomsOfficeType02 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CustomsOfficeType02) 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 CustomsOfficeType02 Return CType(SerializerXml.Deserialize(s), CustomsOfficeType02) End Function #End Region ''' ''' Serializes current CustomsOfficeType02 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 CustomsOfficeType02 object ''' ''' File to load and deserialize ''' Output CustomsOfficeType02 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 CustomsOfficeType02, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CustomsOfficeType02) 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 CustomsOfficeType02) 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 CustomsOfficeType02 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 GNSSType #Region "Private fields" Private _latitude As String Private _longitude As String Private Shared _serializerXml As XmlSerializer #End Region Public Property latitude() As String Get Return Me._latitude End Get Set Me._latitude = Value End Set End Property Public Property longitude() As String Get Return Me._longitude End Get Set Me._longitude = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(GNSSType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize GNSSType 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() 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 GNSSType object ''' ''' string to deserialize ''' Output GNSSType 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 GNSSType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GNSSType) 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 GNSSType) 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 GNSSType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), GNSSType) 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 GNSSType Return CType(SerializerXml.Deserialize(s), GNSSType) End Function #End Region ''' ''' Serializes current GNSSType 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 GNSSType object ''' ''' File to load and deserialize ''' Output GNSSType 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 GNSSType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GNSSType) 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 GNSSType) 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 GNSSType 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 EconomicOperatorType03 #Region "Private fields" Private _identificationNumber As String Private Shared _serializerXml As XmlSerializer #End Region 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(EconomicOperatorType03)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize EconomicOperatorType03 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() 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 EconomicOperatorType03 object ''' ''' string to deserialize ''' Output EconomicOperatorType03 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 EconomicOperatorType03, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, EconomicOperatorType03) 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 EconomicOperatorType03) 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 EconomicOperatorType03 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), EconomicOperatorType03) 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 EconomicOperatorType03 Return CType(SerializerXml.Deserialize(s), EconomicOperatorType03) End Function #End Region ''' ''' Serializes current EconomicOperatorType03 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 EconomicOperatorType03 object ''' ''' File to load and deserialize ''' Output EconomicOperatorType03 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 EconomicOperatorType03, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, EconomicOperatorType03) 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 EconomicOperatorType03) 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 EconomicOperatorType03 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 AddressType14 #Region "Private fields" Private _streetAndNumber As String Private _postcode As String Private _city As String Private _country As String Private Shared _serializerXml As XmlSerializer #End Region Public Property streetAndNumber() As String Get Return Me._streetAndNumber End Get Set Me._streetAndNumber = 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 city() As String Get Return Me._city End Get Set Me._city = 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(AddressType14)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AddressType14 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() 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 AddressType14 object ''' ''' string to deserialize ''' Output AddressType14 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 AddressType14, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AddressType14) 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 AddressType14) 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 AddressType14 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AddressType14) 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 AddressType14 Return CType(SerializerXml.Deserialize(s), AddressType14) End Function #End Region ''' ''' Serializes current AddressType14 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 AddressType14 object ''' ''' File to load and deserialize ''' Output AddressType14 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 AddressType14, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AddressType14) 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 AddressType14) 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 AddressType14 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 PostcodeAddressType02 #Region "Private fields" Private _houseNumber As String Private _postcode As String Private _country As String Private Shared _serializerXml As XmlSerializer #End Region Public Property houseNumber() As String Get Return Me._houseNumber End Get Set Me._houseNumber = 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 Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PostcodeAddressType02)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize PostcodeAddressType02 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() 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 PostcodeAddressType02 object ''' ''' string to deserialize ''' Output PostcodeAddressType02 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 PostcodeAddressType02, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PostcodeAddressType02) 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 PostcodeAddressType02) 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 PostcodeAddressType02 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PostcodeAddressType02) 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 PostcodeAddressType02 Return CType(SerializerXml.Deserialize(s), PostcodeAddressType02) End Function #End Region ''' ''' Serializes current PostcodeAddressType02 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 PostcodeAddressType02 object ''' ''' File to load and deserialize ''' Output PostcodeAddressType02 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 PostcodeAddressType02, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PostcodeAddressType02) 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 PostcodeAddressType02) 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 PostcodeAddressType02 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 ContactPersonType06 #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(ContactPersonType06)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ContactPersonType06 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() 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 ContactPersonType06 object ''' ''' string to deserialize ''' Output ContactPersonType06 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 ContactPersonType06, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ContactPersonType06) 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 ContactPersonType06) 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 ContactPersonType06 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ContactPersonType06) 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 ContactPersonType06 Return CType(SerializerXml.Deserialize(s), ContactPersonType06) End Function #End Region ''' ''' Serializes current ContactPersonType06 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 ContactPersonType06 object ''' ''' File to load and deserialize ''' Output ContactPersonType06 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 ContactPersonType06, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ContactPersonType06) 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 ContactPersonType06) 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 ContactPersonType06 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 DepartureTransportMeansType03 #Region "Private fields" Private _sequenceNumber As String Private _typeOfIdentification As String Private _identificationNumber As String Private _nationality As String Private Shared _serializerXml As XmlSerializer #End Region Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = Value End Set End Property 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(DepartureTransportMeansType03)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize DepartureTransportMeansType03 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() 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 DepartureTransportMeansType03 object ''' ''' string to deserialize ''' Output DepartureTransportMeansType03 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 DepartureTransportMeansType03, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DepartureTransportMeansType03) 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 DepartureTransportMeansType03) 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 DepartureTransportMeansType03 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), DepartureTransportMeansType03) 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 DepartureTransportMeansType03 Return CType(SerializerXml.Deserialize(s), DepartureTransportMeansType03) End Function #End Region ''' ''' Serializes current DepartureTransportMeansType03 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 DepartureTransportMeansType03 object ''' ''' File to load and deserialize ''' Output DepartureTransportMeansType03 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 DepartureTransportMeansType03, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DepartureTransportMeansType03) 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 DepartureTransportMeansType03) 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 DepartureTransportMeansType03 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 CountryOfRoutingOfConsignmentType01 #Region "Private fields" Private _sequenceNumber As String Private _country As String Private Shared _serializerXml As XmlSerializer #End Region Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = 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(CountryOfRoutingOfConsignmentType01)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize CountryOfRoutingOfConsignmentType01 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() 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 CountryOfRoutingOfConsignmentType01 object ''' ''' string to deserialize ''' Output CountryOfRoutingOfConsignmentType01 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 CountryOfRoutingOfConsignmentType01, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CountryOfRoutingOfConsignmentType01) 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 CountryOfRoutingOfConsignmentType01) 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 CountryOfRoutingOfConsignmentType01 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CountryOfRoutingOfConsignmentType01) 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 CountryOfRoutingOfConsignmentType01 Return CType(SerializerXml.Deserialize(s), CountryOfRoutingOfConsignmentType01) End Function #End Region ''' ''' Serializes current CountryOfRoutingOfConsignmentType01 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 CountryOfRoutingOfConsignmentType01 object ''' ''' File to load and deserialize ''' Output CountryOfRoutingOfConsignmentType01 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 CountryOfRoutingOfConsignmentType01, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CountryOfRoutingOfConsignmentType01) 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 CountryOfRoutingOfConsignmentType01) 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 CountryOfRoutingOfConsignmentType01 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 ActiveBorderTransportMeansType02 #Region "Private fields" Private _sequenceNumber As String Private _customsOfficeAtBorderReferenceNumber As String Private _typeOfIdentification As String Private _identificationNumber As String Private _nationality As String Private _conveyanceReferenceNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = Value End Set End Property Public Property customsOfficeAtBorderReferenceNumber() As String Get Return Me._customsOfficeAtBorderReferenceNumber End Get Set Me._customsOfficeAtBorderReferenceNumber = Value End Set End Property 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 Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ActiveBorderTransportMeansType02)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ActiveBorderTransportMeansType02 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() 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 ActiveBorderTransportMeansType02 object ''' ''' string to deserialize ''' Output ActiveBorderTransportMeansType02 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 ActiveBorderTransportMeansType02, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ActiveBorderTransportMeansType02) 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 ActiveBorderTransportMeansType02) 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 ActiveBorderTransportMeansType02 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ActiveBorderTransportMeansType02) 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 ActiveBorderTransportMeansType02 Return CType(SerializerXml.Deserialize(s), ActiveBorderTransportMeansType02) End Function #End Region ''' ''' Serializes current ActiveBorderTransportMeansType02 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 ActiveBorderTransportMeansType02 object ''' ''' File to load and deserialize ''' Output ActiveBorderTransportMeansType02 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 ActiveBorderTransportMeansType02, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ActiveBorderTransportMeansType02) 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 ActiveBorderTransportMeansType02) 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 ActiveBorderTransportMeansType02 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 PlaceOfLoadingType03 #Region "Private fields" Private _uNLocode As String Private _country As String Private _location As String Private Shared _serializerXml As XmlSerializer #End Region Public Property UNLocode() As String Get Return Me._uNLocode End Get Set Me._uNLocode = 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 location() As String Get Return Me._location End Get Set Me._location = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PlaceOfLoadingType03)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize PlaceOfLoadingType03 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() 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 PlaceOfLoadingType03 object ''' ''' string to deserialize ''' Output PlaceOfLoadingType03 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 PlaceOfLoadingType03, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PlaceOfLoadingType03) 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 PlaceOfLoadingType03) 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 PlaceOfLoadingType03 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PlaceOfLoadingType03) 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 PlaceOfLoadingType03 Return CType(SerializerXml.Deserialize(s), PlaceOfLoadingType03) End Function #End Region ''' ''' Serializes current PlaceOfLoadingType03 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 PlaceOfLoadingType03 object ''' ''' File to load and deserialize ''' Output PlaceOfLoadingType03 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 PlaceOfLoadingType03, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PlaceOfLoadingType03) 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 PlaceOfLoadingType03) 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 PlaceOfLoadingType03 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 PlaceOfUnloadingType01 #Region "Private fields" Private _uNLocode As String Private _country As String Private _location As String Private Shared _serializerXml As XmlSerializer #End Region Public Property UNLocode() As String Get Return Me._uNLocode End Get Set Me._uNLocode = 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 location() As String Get Return Me._location End Get Set Me._location = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PlaceOfUnloadingType01)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize PlaceOfUnloadingType01 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() 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 PlaceOfUnloadingType01 object ''' ''' string to deserialize ''' Output PlaceOfUnloadingType01 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 PlaceOfUnloadingType01, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PlaceOfUnloadingType01) 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 PlaceOfUnloadingType01) 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 PlaceOfUnloadingType01 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PlaceOfUnloadingType01) 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 PlaceOfUnloadingType01 Return CType(SerializerXml.Deserialize(s), PlaceOfUnloadingType01) End Function #End Region ''' ''' Serializes current PlaceOfUnloadingType01 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 PlaceOfUnloadingType01 object ''' ''' File to load and deserialize ''' Output PlaceOfUnloadingType01 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 PlaceOfUnloadingType01, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PlaceOfUnloadingType01) 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 PlaceOfUnloadingType01) 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 PlaceOfUnloadingType01 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 PreviousDocumentType09 #Region "Private fields" Private _sequenceNumber As String Private _type As String Private _referenceNumber As String Private _complementOfInformation As String Private Shared _serializerXml As XmlSerializer #End Region Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = Value End Set End Property 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(PreviousDocumentType09)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize PreviousDocumentType09 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() 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 PreviousDocumentType09 object ''' ''' string to deserialize ''' Output PreviousDocumentType09 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 PreviousDocumentType09, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PreviousDocumentType09) 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 PreviousDocumentType09) 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 PreviousDocumentType09 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PreviousDocumentType09) 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 PreviousDocumentType09 Return CType(SerializerXml.Deserialize(s), PreviousDocumentType09) End Function #End Region ''' ''' Serializes current PreviousDocumentType09 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 PreviousDocumentType09 object ''' ''' File to load and deserialize ''' Output PreviousDocumentType09 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 PreviousDocumentType09, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PreviousDocumentType09) 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 PreviousDocumentType09) 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 PreviousDocumentType09 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 SupportingDocumentType05 #Region "Private fields" Private _sequenceNumber As String 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 sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = Value End Set End Property 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(SupportingDocumentType05)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize SupportingDocumentType05 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() 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 SupportingDocumentType05 object ''' ''' string to deserialize ''' Output SupportingDocumentType05 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 SupportingDocumentType05, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SupportingDocumentType05) 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 SupportingDocumentType05) 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 SupportingDocumentType05 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SupportingDocumentType05) 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 SupportingDocumentType05 Return CType(SerializerXml.Deserialize(s), SupportingDocumentType05) End Function #End Region ''' ''' Serializes current SupportingDocumentType05 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 SupportingDocumentType05 object ''' ''' File to load and deserialize ''' Output SupportingDocumentType05 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 SupportingDocumentType05, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SupportingDocumentType05) 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 SupportingDocumentType05) 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 SupportingDocumentType05 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 TransportDocumentType04 #Region "Private fields" Private _sequenceNumber As String Private _type As String Private _referenceNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = Value End Set End Property 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(TransportDocumentType04)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize TransportDocumentType04 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() 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 TransportDocumentType04 object ''' ''' string to deserialize ''' Output TransportDocumentType04 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 TransportDocumentType04, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransportDocumentType04) 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 TransportDocumentType04) 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 TransportDocumentType04 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransportDocumentType04) 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 TransportDocumentType04 Return CType(SerializerXml.Deserialize(s), TransportDocumentType04) End Function #End Region ''' ''' Serializes current TransportDocumentType04 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 TransportDocumentType04 object ''' ''' File to load and deserialize ''' Output TransportDocumentType04 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 TransportDocumentType04, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransportDocumentType04) 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 TransportDocumentType04) 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 TransportDocumentType04 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 AdditionalReferenceType05 #Region "Private fields" Private _sequenceNumber As String Private _type As String Private _referenceNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = Value End Set End Property 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(AdditionalReferenceType05)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AdditionalReferenceType05 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() 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 AdditionalReferenceType05 object ''' ''' string to deserialize ''' Output AdditionalReferenceType05 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 AdditionalReferenceType05, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalReferenceType05) 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 AdditionalReferenceType05) 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 AdditionalReferenceType05 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdditionalReferenceType05) 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 AdditionalReferenceType05 Return CType(SerializerXml.Deserialize(s), AdditionalReferenceType05) End Function #End Region ''' ''' Serializes current AdditionalReferenceType05 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 AdditionalReferenceType05 object ''' ''' File to load and deserialize ''' Output AdditionalReferenceType05 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 AdditionalReferenceType05, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalReferenceType05) 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 AdditionalReferenceType05) 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 AdditionalReferenceType05 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 AdditionalInformationType03 #Region "Private fields" Private _sequenceNumber As String Private _code As String Private _text As String Private Shared _serializerXml As XmlSerializer #End Region Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = Value End Set End Property 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(AdditionalInformationType03)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AdditionalInformationType03 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() 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 AdditionalInformationType03 object ''' ''' string to deserialize ''' Output AdditionalInformationType03 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 AdditionalInformationType03, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalInformationType03) 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 AdditionalInformationType03) 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 AdditionalInformationType03 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdditionalInformationType03) 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 AdditionalInformationType03 Return CType(SerializerXml.Deserialize(s), AdditionalInformationType03) End Function #End Region ''' ''' Serializes current AdditionalInformationType03 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 AdditionalInformationType03 object ''' ''' File to load and deserialize ''' Output AdditionalInformationType03 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 AdditionalInformationType03, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalInformationType03) 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 AdditionalInformationType03) 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 AdditionalInformationType03 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 TransportChargesType #Region "Private fields" Private _methodOfPayment As String Private Shared _serializerXml As XmlSerializer #End Region Public Property methodOfPayment() As String Get Return Me._methodOfPayment End Get Set Me._methodOfPayment = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransportChargesType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize TransportChargesType 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() 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 TransportChargesType object ''' ''' string to deserialize ''' Output TransportChargesType 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 TransportChargesType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransportChargesType) 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 TransportChargesType) 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 TransportChargesType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransportChargesType) 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 TransportChargesType Return CType(SerializerXml.Deserialize(s), TransportChargesType) End Function #End Region ''' ''' Serializes current TransportChargesType 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 TransportChargesType object ''' ''' File to load and deserialize ''' Output TransportChargesType 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 TransportChargesType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransportChargesType) 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 TransportChargesType) 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 TransportChargesType 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 HouseConsignmentType10 #Region "Private fields" Private _sequenceNumber As String Private _countryOfDispatch As String Private _countryOfDestination As String Private _grossMass As Decimal Private _referenceNumberUCR As String Private _consignor As ConsignorType07 Private _consignee As ConsigneeType05 Private _additionalSupplyChainActor As List(Of AdditionalSupplyChainActorType) Private _departureTransportMeans As List(Of DepartureTransportMeansType05) Private _previousDocument As List(Of PreviousDocumentType10) Private _supportingDocument As List(Of SupportingDocumentType05) Private _transportDocument As List(Of TransportDocumentType04) Private _additionalReference As List(Of AdditionalReferenceType05) Private _additionalInformation As List(Of AdditionalInformationType03) Private _transportCharges As TransportChargesType Private _consignmentItem As List(Of ConsignmentItemType09) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._consignmentItem = New List(Of ConsignmentItemType09)() Me._transportCharges = New TransportChargesType() Me._additionalInformation = New List(Of AdditionalInformationType03)() Me._additionalReference = New List(Of AdditionalReferenceType05)() Me._transportDocument = New List(Of TransportDocumentType04)() Me._supportingDocument = New List(Of SupportingDocumentType05)() Me._previousDocument = New List(Of PreviousDocumentType10)() Me._departureTransportMeans = New List(Of DepartureTransportMeansType05)() Me._additionalSupplyChainActor = New List(Of AdditionalSupplyChainActorType)() Me._consignee = New ConsigneeType05() Me._consignor = New ConsignorType07() End Sub Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = 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 Decimal 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 ConsignorType07 Get Return Me._consignor End Get Set Me._consignor = Value End Set End Property Public Property Consignee() As ConsigneeType05 Get Return Me._consignee End Get Set Me._consignee = Value End Set End Property Public Property AdditionalSupplyChainActor() As List(Of AdditionalSupplyChainActorType) Get Return Me._additionalSupplyChainActor End Get Set Me._additionalSupplyChainActor = Value End Set End Property Public Property DepartureTransportMeans() As List(Of DepartureTransportMeansType05) Get Return Me._departureTransportMeans End Get Set Me._departureTransportMeans = Value End Set End Property Public Property PreviousDocument() As List(Of PreviousDocumentType10) Get Return Me._previousDocument End Get Set Me._previousDocument = Value End Set End Property Public Property SupportingDocument() As List(Of SupportingDocumentType05) Get Return Me._supportingDocument End Get Set Me._supportingDocument = Value End Set End Property Public Property TransportDocument() As List(Of TransportDocumentType04) Get Return Me._transportDocument End Get Set Me._transportDocument = Value End Set End Property Public Property AdditionalReference() As List(Of AdditionalReferenceType05) Get Return Me._additionalReference End Get Set Me._additionalReference = Value End Set End Property Public Property AdditionalInformation() As List(Of AdditionalInformationType03) Get Return Me._additionalInformation End Get Set Me._additionalInformation = Value End Set End Property Public Property TransportCharges() As TransportChargesType Get Return Me._transportCharges End Get Set Me._transportCharges = Value End Set End Property Public Property ConsignmentItem() As List(Of ConsignmentItemType09) 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(HouseConsignmentType10)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize HouseConsignmentType10 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() 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 HouseConsignmentType10 object ''' ''' string to deserialize ''' Output HouseConsignmentType10 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 HouseConsignmentType10, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, HouseConsignmentType10) 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 HouseConsignmentType10) 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 HouseConsignmentType10 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HouseConsignmentType10) 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 HouseConsignmentType10 Return CType(SerializerXml.Deserialize(s), HouseConsignmentType10) End Function #End Region ''' ''' Serializes current HouseConsignmentType10 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 HouseConsignmentType10 object ''' ''' File to load and deserialize ''' Output HouseConsignmentType10 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 HouseConsignmentType10, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, HouseConsignmentType10) 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 HouseConsignmentType10) 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 HouseConsignmentType10 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 DepartureTransportMeansType05 #Region "Private fields" Private _sequenceNumber As String Private _typeOfIdentification As String Private _identificationNumber As String Private _nationality As String Private Shared _serializerXml As XmlSerializer #End Region Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = Value End Set End Property 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(DepartureTransportMeansType05)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize DepartureTransportMeansType05 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() 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 DepartureTransportMeansType05 object ''' ''' string to deserialize ''' Output DepartureTransportMeansType05 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 DepartureTransportMeansType05, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DepartureTransportMeansType05) 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 DepartureTransportMeansType05) 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 DepartureTransportMeansType05 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), DepartureTransportMeansType05) 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 DepartureTransportMeansType05 Return CType(SerializerXml.Deserialize(s), DepartureTransportMeansType05) End Function #End Region ''' ''' Serializes current DepartureTransportMeansType05 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 DepartureTransportMeansType05 object ''' ''' File to load and deserialize ''' Output DepartureTransportMeansType05 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 DepartureTransportMeansType05, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DepartureTransportMeansType05) 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 DepartureTransportMeansType05) 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 DepartureTransportMeansType05 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 PreviousDocumentType10 #Region "Private fields" Private _sequenceNumber As String Private _type As String Private _referenceNumber As String Private _complementOfInformation As String Private Shared _serializerXml As XmlSerializer #End Region Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = Value End Set End Property 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(PreviousDocumentType10)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize PreviousDocumentType10 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() 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 PreviousDocumentType10 object ''' ''' string to deserialize ''' Output PreviousDocumentType10 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 PreviousDocumentType10, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PreviousDocumentType10) 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 PreviousDocumentType10) 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 PreviousDocumentType10 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PreviousDocumentType10) 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 PreviousDocumentType10 Return CType(SerializerXml.Deserialize(s), PreviousDocumentType10) End Function #End Region ''' ''' Serializes current PreviousDocumentType10 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 PreviousDocumentType10 object ''' ''' File to load and deserialize ''' Output PreviousDocumentType10 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 PreviousDocumentType10, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PreviousDocumentType10) 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 PreviousDocumentType10) 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 PreviousDocumentType10 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 ConsignmentItemType09 #Region "Private fields" Private _goodsItemNumber As String Private _declarationGoodsItemNumber As String Private _declarationType As String Private _countryOfDispatch As String Private _countryOfDestination As String Private _referenceNumberUCR As String Private _consignee As ConsigneeType02 Private _additionalSupplyChainActor As List(Of AdditionalSupplyChainActorType) Private _commodity As CommodityType07 Private _packaging As List(Of PackagingType03) Private _previousDocument As List(Of PreviousDocumentType08) Private _supportingDocument As List(Of SupportingDocumentType05) Private _transportDocument As List(Of TransportDocumentType04) Private _additionalReference As List(Of AdditionalReferenceType04) Private _additionalInformation As List(Of AdditionalInformationType03) Private _transportCharges As TransportChargesType Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._transportCharges = New TransportChargesType() Me._additionalInformation = New List(Of AdditionalInformationType03)() Me._additionalReference = New List(Of AdditionalReferenceType04)() Me._transportDocument = New List(Of TransportDocumentType04)() Me._supportingDocument = New List(Of SupportingDocumentType05)() Me._previousDocument = New List(Of PreviousDocumentType08)() Me._packaging = New List(Of PackagingType03)() Me._commodity = New CommodityType07() Me._additionalSupplyChainActor = New List(Of AdditionalSupplyChainActorType)() Me._consignee = New ConsigneeType02() 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 declarationType() As String Get Return Me._declarationType End Get Set Me._declarationType = 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 referenceNumberUCR() As String Get Return Me._referenceNumberUCR End Get Set Me._referenceNumberUCR = Value End Set End Property Public Property Consignee() As ConsigneeType02 Get Return Me._consignee End Get Set Me._consignee = Value End Set End Property Public Property AdditionalSupplyChainActor() As List(Of AdditionalSupplyChainActorType) Get Return Me._additionalSupplyChainActor End Get Set Me._additionalSupplyChainActor = Value End Set End Property Public Property Commodity() As CommodityType07 Get Return Me._commodity End Get Set Me._commodity = Value End Set End Property Public Property Packaging() As List(Of PackagingType03) Get Return Me._packaging End Get Set Me._packaging = Value End Set End Property Public Property PreviousDocument() As List(Of PreviousDocumentType08) Get Return Me._previousDocument End Get Set Me._previousDocument = Value End Set End Property Public Property SupportingDocument() As List(Of SupportingDocumentType05) Get Return Me._supportingDocument End Get Set Me._supportingDocument = Value End Set End Property Public Property TransportDocument() As List(Of TransportDocumentType04) Get Return Me._transportDocument End Get Set Me._transportDocument = Value End Set End Property Public Property AdditionalReference() As List(Of AdditionalReferenceType04) Get Return Me._additionalReference End Get Set Me._additionalReference = Value End Set End Property Public Property AdditionalInformation() As List(Of AdditionalInformationType03) Get Return Me._additionalInformation End Get Set Me._additionalInformation = Value End Set End Property Public Property TransportCharges() As TransportChargesType Get Return Me._transportCharges End Get Set Me._transportCharges = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ConsignmentItemType09)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ConsignmentItemType09 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() 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 ConsignmentItemType09 object ''' ''' string to deserialize ''' Output ConsignmentItemType09 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 ConsignmentItemType09, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ConsignmentItemType09) 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 ConsignmentItemType09) 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 ConsignmentItemType09 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ConsignmentItemType09) 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 ConsignmentItemType09 Return CType(SerializerXml.Deserialize(s), ConsignmentItemType09) End Function #End Region ''' ''' Serializes current ConsignmentItemType09 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 ConsignmentItemType09 object ''' ''' File to load and deserialize ''' Output ConsignmentItemType09 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 ConsignmentItemType09, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ConsignmentItemType09) 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 ConsignmentItemType09) 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 ConsignmentItemType09 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 ConsigneeType02 #Region "Private fields" Private _identificationNumber As String Private _name As String Private _address As AddressType12 Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._address = New AddressType12() End Sub Public Property identificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = 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 Address() As AddressType12 Get Return Me._address End Get Set Me._address = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ConsigneeType02)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ConsigneeType02 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() 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 ConsigneeType02 object ''' ''' string to deserialize ''' Output ConsigneeType02 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 ConsigneeType02, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ConsigneeType02) 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 ConsigneeType02) 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 ConsigneeType02 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ConsigneeType02) 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 ConsigneeType02 Return CType(SerializerXml.Deserialize(s), ConsigneeType02) End Function #End Region ''' ''' Serializes current ConsigneeType02 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 ConsigneeType02 object ''' ''' File to load and deserialize ''' Output ConsigneeType02 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 ConsigneeType02, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ConsigneeType02) 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 ConsigneeType02) 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 ConsigneeType02 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 AddressType12 #Region "Private fields" Private _streetAndNumber As String Private _postcode As String Private _city As String Private _country As String Private Shared _serializerXml As XmlSerializer #End Region Public Property streetAndNumber() As String Get Return Me._streetAndNumber End Get Set Me._streetAndNumber = 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 city() As String Get Return Me._city End Get Set Me._city = 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(AddressType12)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AddressType12 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() 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 AddressType12 object ''' ''' string to deserialize ''' Output AddressType12 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 AddressType12, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AddressType12) 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 AddressType12) 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 AddressType12 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AddressType12) 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 AddressType12 Return CType(SerializerXml.Deserialize(s), AddressType12) End Function #End Region ''' ''' Serializes current AddressType12 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 AddressType12 object ''' ''' File to load and deserialize ''' Output AddressType12 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 AddressType12, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AddressType12) 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 AddressType12) 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 AddressType12 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 CommodityType07 #Region "Private fields" Private _descriptionOfGoods As String Private _cusCode As String Private _commodityCode As CommodityCodeType02 Private _dangerousGoods As List(Of DangerousGoodsType01) Private _goodsMeasure As GoodsMeasureType02 Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._goodsMeasure = New GoodsMeasureType02() Me._dangerousGoods = New List(Of DangerousGoodsType01)() Me._commodityCode = New CommodityCodeType02() End Sub 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 CommodityCode() As CommodityCodeType02 Get Return Me._commodityCode End Get Set Me._commodityCode = Value End Set End Property Public Property DangerousGoods() As List(Of DangerousGoodsType01) Get Return Me._dangerousGoods End Get Set Me._dangerousGoods = Value End Set End Property Public Property GoodsMeasure() As GoodsMeasureType02 Get Return Me._goodsMeasure End Get Set Me._goodsMeasure = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CommodityType07)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize CommodityType07 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() 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 CommodityType07 object ''' ''' string to deserialize ''' Output CommodityType07 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 CommodityType07, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CommodityType07) 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 CommodityType07) 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 CommodityType07 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CommodityType07) 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 CommodityType07 Return CType(SerializerXml.Deserialize(s), CommodityType07) End Function #End Region ''' ''' Serializes current CommodityType07 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 CommodityType07 object ''' ''' File to load and deserialize ''' Output CommodityType07 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 CommodityType07, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CommodityType07) 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 CommodityType07) 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 CommodityType07 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 CommodityCodeType02 #Region "Private fields" Private _harmonizedSystemSubHeadingCode As String Private _combinedNomenclatureCode As String Private Shared _serializerXml As XmlSerializer #End Region Public Property harmonizedSystemSubHeadingCode() As String Get Return Me._harmonizedSystemSubHeadingCode End Get Set Me._harmonizedSystemSubHeadingCode = Value End Set End Property Public Property combinedNomenclatureCode() As String Get Return Me._combinedNomenclatureCode End Get Set Me._combinedNomenclatureCode = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CommodityCodeType02)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize CommodityCodeType02 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() 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 CommodityCodeType02 object ''' ''' string to deserialize ''' Output CommodityCodeType02 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 CommodityCodeType02, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CommodityCodeType02) 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 CommodityCodeType02) 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 CommodityCodeType02 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CommodityCodeType02) 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 CommodityCodeType02 Return CType(SerializerXml.Deserialize(s), CommodityCodeType02) End Function #End Region ''' ''' Serializes current CommodityCodeType02 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 CommodityCodeType02 object ''' ''' File to load and deserialize ''' Output CommodityCodeType02 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 CommodityCodeType02, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CommodityCodeType02) 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 CommodityCodeType02) 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 CommodityCodeType02 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 DangerousGoodsType01 #Region "Private fields" Private _sequenceNumber As String Private _uNNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = Value End Set End Property Public Property UNNumber() As String Get Return Me._uNNumber End Get Set Me._uNNumber = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(DangerousGoodsType01)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize DangerousGoodsType01 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() 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 DangerousGoodsType01 object ''' ''' string to deserialize ''' Output DangerousGoodsType01 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 DangerousGoodsType01, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DangerousGoodsType01) 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 DangerousGoodsType01) 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 DangerousGoodsType01 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), DangerousGoodsType01) 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 DangerousGoodsType01 Return CType(SerializerXml.Deserialize(s), DangerousGoodsType01) End Function #End Region ''' ''' Serializes current DangerousGoodsType01 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 DangerousGoodsType01 object ''' ''' File to load and deserialize ''' Output DangerousGoodsType01 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 DangerousGoodsType01, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DangerousGoodsType01) 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 DangerousGoodsType01) 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 DangerousGoodsType01 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 GoodsMeasureType02 #Region "Private fields" Private _grossMass As Decimal Private _netMass As Decimal Private _supplementaryUnits As Decimal Private Shared _serializerXml As XmlSerializer #End Region Public Property grossMass() As Decimal Get Return Me._grossMass End Get Set Me._grossMass = Value End Set End Property Public Property netMass() As Decimal Get Return Me._netMass End Get Set Me._netMass = Value End Set End Property Public Property supplementaryUnits() As Decimal Get Return Me._supplementaryUnits End Get Set Me._supplementaryUnits = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(GoodsMeasureType02)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize GoodsMeasureType02 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() 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 GoodsMeasureType02 object ''' ''' string to deserialize ''' Output GoodsMeasureType02 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 GoodsMeasureType02, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GoodsMeasureType02) 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 GoodsMeasureType02) 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 GoodsMeasureType02 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), GoodsMeasureType02) 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 GoodsMeasureType02 Return CType(SerializerXml.Deserialize(s), GoodsMeasureType02) End Function #End Region ''' ''' Serializes current GoodsMeasureType02 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 GoodsMeasureType02 object ''' ''' File to load and deserialize ''' Output GoodsMeasureType02 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 GoodsMeasureType02, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GoodsMeasureType02) 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 GoodsMeasureType02) 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 GoodsMeasureType02 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 PackagingType03 #Region "Private fields" Private _sequenceNumber As String Private _typeOfPackages As String Private _numberOfPackages As String Private _shippingMarks As String Private Shared _serializerXml As XmlSerializer #End Region Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = 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 numberOfPackages() As String Get Return Me._numberOfPackages End Get Set Me._numberOfPackages = Value End Set End Property Public Property shippingMarks() As String Get Return Me._shippingMarks End Get Set Me._shippingMarks = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PackagingType03)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize PackagingType03 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() 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 PackagingType03 object ''' ''' string to deserialize ''' Output PackagingType03 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 PackagingType03, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PackagingType03) 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 PackagingType03) 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 PackagingType03 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PackagingType03) 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 PackagingType03 Return CType(SerializerXml.Deserialize(s), PackagingType03) End Function #End Region ''' ''' Serializes current PackagingType03 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 PackagingType03 object ''' ''' File to load and deserialize ''' Output PackagingType03 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 PackagingType03, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PackagingType03) 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 PackagingType03) 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 PackagingType03 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 PreviousDocumentType08 #Region "Private fields" Private _sequenceNumber As String Private _type As String Private _referenceNumber As String Private _goodsItemNumber As String Private _typeOfPackages As String Private _numberOfPackages As String Private _measurementUnitAndQualifier As String Private _quantity As Decimal Private _complementOfInformation As String Private Shared _serializerXml As XmlSerializer #End Region Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = Value End Set End Property 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 goodsItemNumber() As String Get Return Me._goodsItemNumber End Get Set Me._goodsItemNumber = 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 numberOfPackages() As String Get Return Me._numberOfPackages End Get Set Me._numberOfPackages = Value End Set End Property Public Property measurementUnitAndQualifier() As String Get Return Me._measurementUnitAndQualifier End Get Set Me._measurementUnitAndQualifier = Value End Set End Property Public Property quantity() As Decimal Get Return Me._quantity End Get Set Me._quantity = 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(PreviousDocumentType08)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize PreviousDocumentType08 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() 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 PreviousDocumentType08 object ''' ''' string to deserialize ''' Output PreviousDocumentType08 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 PreviousDocumentType08, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PreviousDocumentType08) 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 PreviousDocumentType08) 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 PreviousDocumentType08 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PreviousDocumentType08) 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 PreviousDocumentType08 Return CType(SerializerXml.Deserialize(s), PreviousDocumentType08) End Function #End Region ''' ''' Serializes current PreviousDocumentType08 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 PreviousDocumentType08 object ''' ''' File to load and deserialize ''' Output PreviousDocumentType08 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 PreviousDocumentType08, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PreviousDocumentType08) 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 PreviousDocumentType08) 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 PreviousDocumentType08 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 AdditionalReferenceType04 #Region "Private fields" Private _sequenceNumber As String Private _type As String Private _referenceNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property sequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = Value End Set End Property 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(AdditionalReferenceType04)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AdditionalReferenceType04 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() 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 AdditionalReferenceType04 object ''' ''' string to deserialize ''' Output AdditionalReferenceType04 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 AdditionalReferenceType04, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalReferenceType04) 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 AdditionalReferenceType04) 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 AdditionalReferenceType04 Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdditionalReferenceType04) 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 AdditionalReferenceType04 Return CType(SerializerXml.Deserialize(s), AdditionalReferenceType04) End Function #End Region ''' ''' Serializes current AdditionalReferenceType04 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 AdditionalReferenceType04 object ''' ''' File to load and deserialize ''' Output AdditionalReferenceType04 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 AdditionalReferenceType04, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalReferenceType04) 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 AdditionalReferenceType04) 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 AdditionalReferenceType04 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 Public Enum phaseIDtype NCTS51 NCTS50 End Enum End Namespace #Enable Warning