'' ------------------------------------------------------------------------------ '' '' Generated by Xsd2Code++. Version 4.4.0.7 '' DEXPDDListVisualBasicFalseFalseFalseOnlyIfDifferentFalseNet45AllTrueTrueTrueFalseFalseFalseFalseFalseNoneStartWithUnderscoreFalseFalseFalseFalseFalsePublicTrueFalseFalseFalseFalseFalseFalseFalseFalseTrueTrueTrueFalseTrueSerializeDeserializeSaveToFileLoadFromFileFalseTrueIndent2SpaceFalseFalseUTF8XmlSerializerFalseFalseFalseFalseFalseFalseFalseEntityBaseFalseFalse '' '' ------------------------------------------------------------------------------ Imports System Imports System.Diagnostics Imports System.Xml.Serialization Imports System.Collections Imports System.Xml.Schema Imports System.ComponentModel Imports System.IO Imports System.Text Imports System.Xml Imports System.Collections.Generic Namespace DEXPDD _ Partial Public Class DEXPDD #Region "Private fields" Private _interchangeSender As DEXPDDInterchangeSender Private _interchangeRecipient As DEXPDDInterchangeRecipient Private _preparation As DEXPDDPreparation Private _interchangeControlReference As String Private _messageGroup As DEXPDDMessageGroup Private _messageReferenceNumber As String Private _messageType As DEXPDDMessageType Private _messageIdentifier As String Private _header As DEXPDDHeader Private _goodsLoadingPlace As DEXPDDGoodsLoadingPlace Private _exportCustomsOffice As DEXPDDExportCustomsOffice Private _supplementaryDeclarationCustomsOffice As DEXPDDSupplementaryDeclarationCustomsOffice Private _intendedExitCustomsOffice As DEXPDDIntendedExitCustomsOffice Private _actualExitCustomsOffice As DEXPDDActualExitCustomsOffice Private _transaction As DEXPDDTransaction Private _specialFact As List(Of DEXPDDSpecialFact) Private _itinerary As List(Of DEXPDDItinerary) Private _seals As DEXPDDSeals Private _presentationPackingLoading As DEXPDDPresentationPackingLoading Private _exporter As DEXPDDExporter Private _declarant As DEXPDDDeclarant Private _representative As DEXPDDRepresentative Private _contractor As DEXPDDContractor Private _outwardProcessingOwner As DEXPDDOutwardProcessingOwner Private _consignee As DEXPDDConsignee Private _deliveryTerms As DEXPDDDeliveryTerms Private _outwardProcessing As DEXPDDOutwardProcessing Private _goodsItem As List(Of DEXPDDGoodsItem) Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._goodsItem = New List(Of DEXPDDGoodsItem)() Me._outwardProcessing = New DEXPDDOutwardProcessing() Me._deliveryTerms = New DEXPDDDeliveryTerms() Me._consignee = New DEXPDDConsignee() Me._outwardProcessingOwner = New DEXPDDOutwardProcessingOwner() Me._contractor = New DEXPDDContractor() Me._representative = New DEXPDDRepresentative() Me._declarant = New DEXPDDDeclarant() Me._exporter = New DEXPDDExporter() Me._presentationPackingLoading = New DEXPDDPresentationPackingLoading() Me._seals = New DEXPDDSeals() Me._itinerary = New List(Of DEXPDDItinerary)() Me._specialFact = New List(Of DEXPDDSpecialFact)() Me._transaction = New DEXPDDTransaction() Me._actualExitCustomsOffice = New DEXPDDActualExitCustomsOffice() Me._intendedExitCustomsOffice = New DEXPDDIntendedExitCustomsOffice() Me._supplementaryDeclarationCustomsOffice = New DEXPDDSupplementaryDeclarationCustomsOffice() Me._exportCustomsOffice = New DEXPDDExportCustomsOffice() Me._goodsLoadingPlace = New DEXPDDGoodsLoadingPlace() Me._header = New DEXPDDHeader() Me._preparation = New DEXPDDPreparation() Me._interchangeRecipient = New DEXPDDInterchangeRecipient() Me._interchangeSender = New DEXPDDInterchangeSender() End Sub Public Property InterchangeSender() As DEXPDDInterchangeSender Get Return Me._interchangeSender End Get Set(value As DEXPDDInterchangeSender) Me._interchangeSender = Value End Set End Property Public Property InterchangeRecipient() As DEXPDDInterchangeRecipient Get Return Me._interchangeRecipient End Get Set(value As DEXPDDInterchangeRecipient) Me._interchangeRecipient = Value End Set End Property Public Property Preparation() As DEXPDDPreparation Get Return Me._preparation End Get Set(value As DEXPDDPreparation) Me._preparation = Value End Set End Property _ Public Property InterchangeControlReference() As String Get Return Me._interchangeControlReference End Get Set(value As String) Me._interchangeControlReference = Value End Set End Property Public Property MessageGroup() As DEXPDDMessageGroup Get Return Me._messageGroup End Get Set(value As DEXPDDMessageGroup) Me._messageGroup = Value End Set End Property _ Public Property MessageReferenceNumber() As String Get Return Me._messageReferenceNumber End Get Set(value As String) Me._messageReferenceNumber = Value End Set End Property Public Property MessageType() As DEXPDDMessageType Get Return Me._messageType End Get Set(value As DEXPDDMessageType) Me._messageType = Value End Set End Property _ Public Property MessageIdentifier() As String Get Return Me._messageIdentifier End Get Set(value As String) Me._messageIdentifier = Value End Set End Property Public Property Header() As DEXPDDHeader Get Return Me._header End Get Set(value As DEXPDDHeader) Me._header = Value End Set End Property _ Public Property GoodsLoadingPlace() As DEXPDDGoodsLoadingPlace Get Return Me._goodsLoadingPlace End Get Set(value As DEXPDDGoodsLoadingPlace) Me._goodsLoadingPlace = Value End Set End Property Public Property ExportCustomsOffice() As DEXPDDExportCustomsOffice Get Return Me._exportCustomsOffice End Get Set(value As DEXPDDExportCustomsOffice) Me._exportCustomsOffice = Value End Set End Property Public Property SupplementaryDeclarationCustomsOffice() As DEXPDDSupplementaryDeclarationCustomsOffice Get Return Me._supplementaryDeclarationCustomsOffice End Get Set(value As DEXPDDSupplementaryDeclarationCustomsOffice) Me._supplementaryDeclarationCustomsOffice = Value End Set End Property Public Property IntendedExitCustomsOffice() As DEXPDDIntendedExitCustomsOffice Get Return Me._intendedExitCustomsOffice End Get Set(value As DEXPDDIntendedExitCustomsOffice) Me._intendedExitCustomsOffice = Value End Set End Property Public Property ActualExitCustomsOffice() As DEXPDDActualExitCustomsOffice Get Return Me._actualExitCustomsOffice End Get Set(value As DEXPDDActualExitCustomsOffice) Me._actualExitCustomsOffice = Value End Set End Property Public Property Transaction() As DEXPDDTransaction Get Return Me._transaction End Get Set(value As DEXPDDTransaction) Me._transaction = Value End Set End Property _ Public Property SpecialFact() As List(Of DEXPDDSpecialFact) Get Return Me._specialFact End Get Set(value As List(Of DEXPDDSpecialFact)) Me._specialFact = Value End Set End Property _ Public Property Itinerary() As List(Of DEXPDDItinerary) Get Return Me._itinerary End Get Set(value As List(Of DEXPDDItinerary)) Me._itinerary = Value End Set End Property Public Property Seals() As DEXPDDSeals Get Return Me._seals End Get Set(value As DEXPDDSeals) Me._seals = Value End Set End Property Public Property PresentationPackingLoading() As DEXPDDPresentationPackingLoading Get Return Me._presentationPackingLoading End Get Set(value As DEXPDDPresentationPackingLoading) Me._presentationPackingLoading = Value End Set End Property Public Property Exporter() As DEXPDDExporter Get Return Me._exporter End Get Set(value As DEXPDDExporter) Me._exporter = Value End Set End Property Public Property Declarant() As DEXPDDDeclarant Get Return Me._declarant End Get Set(value As DEXPDDDeclarant) Me._declarant = Value End Set End Property Public Property Representative() As DEXPDDRepresentative Get Return Me._representative End Get Set(value As DEXPDDRepresentative) Me._representative = Value End Set End Property Public Property Contractor() As DEXPDDContractor Get Return Me._contractor End Get Set(value As DEXPDDContractor) Me._contractor = Value End Set End Property Public Property OutwardProcessingOwner() As DEXPDDOutwardProcessingOwner Get Return Me._outwardProcessingOwner End Get Set(value As DEXPDDOutwardProcessingOwner) Me._outwardProcessingOwner = Value End Set End Property Public Property Consignee() As DEXPDDConsignee Get Return Me._consignee End Get Set(value As DEXPDDConsignee) Me._consignee = Value End Set End Property Public Property DeliveryTerms() As DEXPDDDeliveryTerms Get Return Me._deliveryTerms End Get Set(value As DEXPDDDeliveryTerms) Me._deliveryTerms = Value End Set End Property Public Property OutwardProcessing() As DEXPDDOutwardProcessing Get Return Me._outwardProcessing End Get Set(value As DEXPDDOutwardProcessing) Me._outwardProcessing = Value End Set End Property _ Public Property GoodsItem() As List(Of DEXPDDGoodsItem) Get Return Me._goodsItem End Get Set(value As List(Of DEXPDDGoodsItem)) Me._goodsItem = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDD)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDD object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDD object ''' ''' string workflow markup to deserialize ''' Output DEXPDD 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 DEXPDD, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDD) 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 DEXPDD) 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 DEXPDD Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDD) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDD Return CType(Serializer.Deserialize(s), DEXPDD) End Function #End Region ''' ''' Serializes current DEXPDD object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDD object ''' ''' string xml file to load and deserialize ''' Output DEXPDD 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 DEXPDD, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDD) 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 DEXPDD) 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 DEXPDD Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDInterchangeSender #Region "Private fields" Private _identification As DEXPDDInterchangeSenderIdentification Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._identification = New DEXPDDInterchangeSenderIdentification() End Sub Public Property Identification() As DEXPDDInterchangeSenderIdentification Get Return Me._identification End Get Set(value As DEXPDDInterchangeSenderIdentification) Me._identification = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDInterchangeSender)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDInterchangeSender object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDInterchangeSender object ''' ''' string workflow markup to deserialize ''' Output DEXPDDInterchangeSender 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 DEXPDDInterchangeSender, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDInterchangeSender) 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 DEXPDDInterchangeSender) 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 DEXPDDInterchangeSender Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDInterchangeSender) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDInterchangeSender Return CType(Serializer.Deserialize(s), DEXPDDInterchangeSender) End Function #End Region ''' ''' Serializes current DEXPDDInterchangeSender object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDInterchangeSender object ''' ''' string xml file to load and deserialize ''' Output DEXPDDInterchangeSender 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 DEXPDDInterchangeSender, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDInterchangeSender) 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 DEXPDDInterchangeSender) 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 DEXPDDInterchangeSender Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDInterchangeSenderIdentification #Region "Private fields" Private _referenceNumber As String Private _subsidiaryNumber As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set(value As String) Me._referenceNumber = Value End Set End Property _ Public Property SubsidiaryNumber() As String Get Return Me._subsidiaryNumber End Get Set(value As String) Me._subsidiaryNumber = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDInterchangeSenderIdentification)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDInterchangeSenderIdentification object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDInterchangeSenderIdentification object ''' ''' string workflow markup to deserialize ''' Output DEXPDDInterchangeSenderIdentification 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 DEXPDDInterchangeSenderIdentification, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDInterchangeSenderIdentification) 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 DEXPDDInterchangeSenderIdentification) 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 DEXPDDInterchangeSenderIdentification Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDInterchangeSenderIdentification) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDInterchangeSenderIdentification Return CType(Serializer.Deserialize(s), DEXPDDInterchangeSenderIdentification) End Function #End Region ''' ''' Serializes current DEXPDDInterchangeSenderIdentification object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDInterchangeSenderIdentification object ''' ''' string xml file to load and deserialize ''' Output DEXPDDInterchangeSenderIdentification 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 DEXPDDInterchangeSenderIdentification, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDInterchangeSenderIdentification) 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 DEXPDDInterchangeSenderIdentification) 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 DEXPDDInterchangeSenderIdentification Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDInterchangeRecipient #Region "Private fields" Private _identification As DEXPDDInterchangeRecipientIdentification Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._identification = New DEXPDDInterchangeRecipientIdentification() End Sub Public Property Identification() As DEXPDDInterchangeRecipientIdentification Get Return Me._identification End Get Set(value As DEXPDDInterchangeRecipientIdentification) Me._identification = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDInterchangeRecipient)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDInterchangeRecipient object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDInterchangeRecipient object ''' ''' string workflow markup to deserialize ''' Output DEXPDDInterchangeRecipient 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 DEXPDDInterchangeRecipient, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDInterchangeRecipient) 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 DEXPDDInterchangeRecipient) 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 DEXPDDInterchangeRecipient Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDInterchangeRecipient) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDInterchangeRecipient Return CType(Serializer.Deserialize(s), DEXPDDInterchangeRecipient) End Function #End Region ''' ''' Serializes current DEXPDDInterchangeRecipient object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDInterchangeRecipient object ''' ''' string xml file to load and deserialize ''' Output DEXPDDInterchangeRecipient 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 DEXPDDInterchangeRecipient, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDInterchangeRecipient) 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 DEXPDDInterchangeRecipient) 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 DEXPDDInterchangeRecipient Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDInterchangeRecipientIdentification #Region "Private fields" Private _referenceNumber As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set(value As String) Me._referenceNumber = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDInterchangeRecipientIdentification)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDInterchangeRecipientIdentification object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDInterchangeRecipientIdentification object ''' ''' string workflow markup to deserialize ''' Output DEXPDDInterchangeRecipientIdentification 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 DEXPDDInterchangeRecipientIdentification, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDInterchangeRecipientIdentification) 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 DEXPDDInterchangeRecipientIdentification) 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 DEXPDDInterchangeRecipientIdentification Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDInterchangeRecipientIdentification) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDInterchangeRecipientIdentification Return CType(Serializer.Deserialize(s), DEXPDDInterchangeRecipientIdentification) End Function #End Region ''' ''' Serializes current DEXPDDInterchangeRecipientIdentification object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDInterchangeRecipientIdentification object ''' ''' string xml file to load and deserialize ''' Output DEXPDDInterchangeRecipientIdentification 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 DEXPDDInterchangeRecipientIdentification, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDInterchangeRecipientIdentification) 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 DEXPDDInterchangeRecipientIdentification) 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 DEXPDDInterchangeRecipientIdentification Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDPreparation #Region "Private fields" Private _date As Date Private _time As Date Private Shared sSerializer As XmlSerializer #End Region _ Public Property [Date]() As Date Get Return Me._date End Get Set(value As Date) Me._date = Value End Set End Property _ Public Property Time() As Date Get Return Me._time End Get Set(value As Date) Me._time = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDPreparation)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDPreparation object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDPreparation object ''' ''' string workflow markup to deserialize ''' Output DEXPDDPreparation 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 DEXPDDPreparation, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDPreparation) 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 DEXPDDPreparation) 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 DEXPDDPreparation Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDPreparation) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDPreparation Return CType(Serializer.Deserialize(s), DEXPDDPreparation) End Function #End Region ''' ''' Serializes current DEXPDDPreparation object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDPreparation object ''' ''' string xml file to load and deserialize ''' Output DEXPDDPreparation 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 DEXPDDPreparation, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDPreparation) 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 DEXPDDPreparation) 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 DEXPDDPreparation Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDMessageGroup ''' EXP End Enum _ Public Enum DEXPDDMessageType ''' DEXPDD End Enum _ Partial Public Class DEXPDDHeader #Region "Private fields" Private _declaration As DEXPDDHeaderDeclaration Private _movementReferenceNumber As String Private _messageVersion As String Private _exportCountry As String Private _destinationCountry As String Private _declarationDateTime As Date Private _decisiveDate As Date Private _exitDate As Date Private _specificCircumstanceIndicator As String Private _transportChargesPaymentMethod As String Private _partyConstellation As DEXPDDHeaderPartyConstellation Private _containerFlag As DEXPDDHeaderContainerFlag Private _totalGrossMassMeasure As Decimal Private _registrationNumber As String Private _annotation As String Private _commercialReferenceNumber As String Private _localReferenceNumber As String Private _goodsItemQuantity As String Private _authorizationNumber As String Private _customsAuthorization As DEXPDDHeaderCustomsAuthorization Private _inlandTransportMeans As DEXPDDHeaderInlandTransportMeans Private _departureTransportMeans As DEXPDDHeaderDepartureTransportMeans Private _borderTransportMeans As DEXPDDHeaderBorderTransportMeans Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._borderTransportMeans = New DEXPDDHeaderBorderTransportMeans() Me._departureTransportMeans = New DEXPDDHeaderDepartureTransportMeans() Me._inlandTransportMeans = New DEXPDDHeaderInlandTransportMeans() Me._customsAuthorization = New DEXPDDHeaderCustomsAuthorization() Me._declaration = New DEXPDDHeaderDeclaration() End Sub Public Property Declaration() As DEXPDDHeaderDeclaration Get Return Me._declaration End Get Set(value As DEXPDDHeaderDeclaration) Me._declaration = Value End Set End Property _ Public Property MovementReferenceNumber() As String Get Return Me._movementReferenceNumber End Get Set(value As String) Me._movementReferenceNumber = Value End Set End Property _ Public Property MessageVersion() As String Get Return Me._messageVersion End Get Set(value As String) Me._messageVersion = Value End Set End Property _ Public Property ExportCountry() As String Get Return Me._exportCountry End Get Set(value As String) Me._exportCountry = Value End Set End Property _ Public Property DestinationCountry() As String Get Return Me._destinationCountry End Get Set(value As String) Me._destinationCountry = Value End Set End Property Public Property DeclarationDateTime() As Date Get Return Me._declarationDateTime End Get Set(value As Date) Me._declarationDateTime = Value End Set End Property _ Public Property DecisiveDate() As Date Get Return Me._decisiveDate End Get Set(value As Date) Me._decisiveDate = Value End Set End Property _ Public Property ExitDate() As Date Get Return Me._exitDate End Get Set(value As Date) Me._exitDate = Value End Set End Property _ Public Property SpecificCircumstanceIndicator() As String Get Return Me._specificCircumstanceIndicator End Get Set(value As String) Me._specificCircumstanceIndicator = Value End Set End Property _ Public Property TransportChargesPaymentMethod() As String Get Return Me._transportChargesPaymentMethod End Get Set(value As String) Me._transportChargesPaymentMethod = Value End Set End Property Public Property PartyConstellation() As DEXPDDHeaderPartyConstellation Get Return Me._partyConstellation End Get Set(value As DEXPDDHeaderPartyConstellation) Me._partyConstellation = Value End Set End Property Public Property ContainerFlag() As DEXPDDHeaderContainerFlag Get Return Me._containerFlag End Get Set(value As DEXPDDHeaderContainerFlag) Me._containerFlag = Value End Set End Property Public Property TotalGrossMassMeasure() As Decimal Get Return Me._totalGrossMassMeasure End Get Set(value As Decimal) Me._totalGrossMassMeasure = Value End Set End Property _ Public Property RegistrationNumber() As String Get Return Me._registrationNumber End Get Set(value As String) Me._registrationNumber = Value End Set End Property _ Public Property Annotation() As String Get Return Me._annotation End Get Set(value As String) Me._annotation = Value End Set End Property _ Public Property CommercialReferenceNumber() As String Get Return Me._commercialReferenceNumber End Get Set(value As String) Me._commercialReferenceNumber = Value End Set End Property _ Public Property LocalReferenceNumber() As String Get Return Me._localReferenceNumber End Get Set(value As String) Me._localReferenceNumber = Value End Set End Property _ Public Property GoodsItemQuantity() As String Get Return Me._goodsItemQuantity End Get Set(value As String) Me._goodsItemQuantity = Value End Set End Property _ Public Property AuthorizationNumber() As String Get Return Me._authorizationNumber End Get Set(value As String) Me._authorizationNumber = Value End Set End Property Public Property CustomsAuthorization() As DEXPDDHeaderCustomsAuthorization Get Return Me._customsAuthorization End Get Set(value As DEXPDDHeaderCustomsAuthorization) Me._customsAuthorization = Value End Set End Property Public Property InlandTransportMeans() As DEXPDDHeaderInlandTransportMeans Get Return Me._inlandTransportMeans End Get Set(value As DEXPDDHeaderInlandTransportMeans) Me._inlandTransportMeans = Value End Set End Property Public Property DepartureTransportMeans() As DEXPDDHeaderDepartureTransportMeans Get Return Me._departureTransportMeans End Get Set(value As DEXPDDHeaderDepartureTransportMeans) Me._departureTransportMeans = Value End Set End Property Public Property BorderTransportMeans() As DEXPDDHeaderBorderTransportMeans Get Return Me._borderTransportMeans End Get Set(value As DEXPDDHeaderBorderTransportMeans) Me._borderTransportMeans = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDHeader)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDHeader object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDHeader object ''' ''' string workflow markup to deserialize ''' Output DEXPDDHeader 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 DEXPDDHeader, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDHeader) 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 DEXPDDHeader) 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 DEXPDDHeader Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDHeader) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDHeader Return CType(Serializer.Deserialize(s), DEXPDDHeader) End Function #End Region ''' ''' Serializes current DEXPDDHeader object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDHeader object ''' ''' string xml file to load and deserialize ''' Output DEXPDDHeader 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 DEXPDDHeader, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDHeader) 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 DEXPDDHeader) 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 DEXPDDHeader Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDHeaderDeclaration #Region "Private fields" Private _type As String Private _procedure As String Private _variant As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property Type() As String Get Return Me._type End Get Set(value As String) Me._type = Value End Set End Property _ Public Property Procedure() As String Get Return Me._procedure End Get Set(value As String) Me._procedure = Value End Set End Property _ Public Property [Variant]() As String Get Return Me._variant End Get Set(value As String) Me._variant = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDHeaderDeclaration)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDHeaderDeclaration object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDHeaderDeclaration object ''' ''' string workflow markup to deserialize ''' Output DEXPDDHeaderDeclaration 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 DEXPDDHeaderDeclaration, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDHeaderDeclaration) 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 DEXPDDHeaderDeclaration) 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 DEXPDDHeaderDeclaration Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDHeaderDeclaration) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDHeaderDeclaration Return CType(Serializer.Deserialize(s), DEXPDDHeaderDeclaration) End Function #End Region ''' ''' Serializes current DEXPDDHeaderDeclaration object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDHeaderDeclaration object ''' ''' string xml file to load and deserialize ''' Output DEXPDDHeaderDeclaration 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 DEXPDDHeaderDeclaration, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDHeaderDeclaration) 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 DEXPDDHeaderDeclaration) 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 DEXPDDHeaderDeclaration Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDHeaderPartyConstellation ''' _ Item0000 ''' _ Item0001 ''' _ Item0003 ''' _ Item0010 ''' _ Item0011 ''' _ Item0013 ''' _ Item0100 ''' _ Item0101 ''' _ Item0103 ''' _ Item0110 ''' _ Item0111 ''' _ Item0113 ''' _ Item1000 ''' _ Item1001 ''' _ Item1002 ''' _ Item1003 ''' _ Item1010 ''' _ Item1011 ''' _ Item1012 ''' _ Item1013 ''' _ Item1100 ''' _ Item1101 ''' _ Item1102 ''' _ Item1103 ''' _ Item1110 ''' _ Item1111 ''' _ Item1112 ''' _ Item1113 End Enum _ Public Enum DEXPDDHeaderContainerFlag ''' _ Item0 ''' _ Item1 End Enum _ Partial Public Class DEXPDDHeaderCustomsAuthorization #Region "Private fields" Private _localClearanceOutwardProcessing As String Private _outwardProcessing As String Private _trustedExporter As String Private _accreditedExporter As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property LocalClearanceOutwardProcessing() As String Get Return Me._localClearanceOutwardProcessing End Get Set(value As String) Me._localClearanceOutwardProcessing = Value End Set End Property _ Public Property OutwardProcessing() As String Get Return Me._outwardProcessing End Get Set(value As String) Me._outwardProcessing = Value End Set End Property _ Public Property TrustedExporter() As String Get Return Me._trustedExporter End Get Set(value As String) Me._trustedExporter = Value End Set End Property _ Public Property AccreditedExporter() As String Get Return Me._accreditedExporter End Get Set(value As String) Me._accreditedExporter = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDHeaderCustomsAuthorization)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDHeaderCustomsAuthorization object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDHeaderCustomsAuthorization object ''' ''' string workflow markup to deserialize ''' Output DEXPDDHeaderCustomsAuthorization 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 DEXPDDHeaderCustomsAuthorization, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDHeaderCustomsAuthorization) 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 DEXPDDHeaderCustomsAuthorization) 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 DEXPDDHeaderCustomsAuthorization Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDHeaderCustomsAuthorization) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDHeaderCustomsAuthorization Return CType(Serializer.Deserialize(s), DEXPDDHeaderCustomsAuthorization) End Function #End Region ''' ''' Serializes current DEXPDDHeaderCustomsAuthorization object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDHeaderCustomsAuthorization object ''' ''' string xml file to load and deserialize ''' Output DEXPDDHeaderCustomsAuthorization 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 DEXPDDHeaderCustomsAuthorization, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDHeaderCustomsAuthorization) 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 DEXPDDHeaderCustomsAuthorization) 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 DEXPDDHeaderCustomsAuthorization Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDHeaderInlandTransportMeans #Region "Private fields" Private _mode As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property Mode() As String Get Return Me._mode End Get Set(value As String) Me._mode = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDHeaderInlandTransportMeans)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDHeaderInlandTransportMeans object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDHeaderInlandTransportMeans object ''' ''' string workflow markup to deserialize ''' Output DEXPDDHeaderInlandTransportMeans 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 DEXPDDHeaderInlandTransportMeans, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDHeaderInlandTransportMeans) 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 DEXPDDHeaderInlandTransportMeans) 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 DEXPDDHeaderInlandTransportMeans Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDHeaderInlandTransportMeans) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDHeaderInlandTransportMeans Return CType(Serializer.Deserialize(s), DEXPDDHeaderInlandTransportMeans) End Function #End Region ''' ''' Serializes current DEXPDDHeaderInlandTransportMeans object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDHeaderInlandTransportMeans object ''' ''' string xml file to load and deserialize ''' Output DEXPDDHeaderInlandTransportMeans 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 DEXPDDHeaderInlandTransportMeans, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDHeaderInlandTransportMeans) 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 DEXPDDHeaderInlandTransportMeans) 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 DEXPDDHeaderInlandTransportMeans Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDHeaderDepartureTransportMeans #Region "Private fields" Private _type As DEXPDDHeaderDepartureTransportMeansType Private _identity As String Private _nationality As String Private Shared sSerializer As XmlSerializer #End Region Public Property Type() As DEXPDDHeaderDepartureTransportMeansType Get Return Me._type End Get Set(value As DEXPDDHeaderDepartureTransportMeansType) Me._type = Value End Set End Property _ Public Property Identity() As String Get Return Me._identity End Get Set(value As String) Me._identity = Value End Set End Property _ Public Property Nationality() As String Get Return Me._nationality End Get Set(value As String) Me._nationality = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDHeaderDepartureTransportMeans)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDHeaderDepartureTransportMeans object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDHeaderDepartureTransportMeans object ''' ''' string workflow markup to deserialize ''' Output DEXPDDHeaderDepartureTransportMeans 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 DEXPDDHeaderDepartureTransportMeans, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDHeaderDepartureTransportMeans) 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 DEXPDDHeaderDepartureTransportMeans) 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 DEXPDDHeaderDepartureTransportMeans Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDHeaderDepartureTransportMeans) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDHeaderDepartureTransportMeans Return CType(Serializer.Deserialize(s), DEXPDDHeaderDepartureTransportMeans) End Function #End Region ''' ''' Serializes current DEXPDDHeaderDepartureTransportMeans object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDHeaderDepartureTransportMeans object ''' ''' string xml file to load and deserialize ''' Output DEXPDDHeaderDepartureTransportMeans 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 DEXPDDHeaderDepartureTransportMeans, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDHeaderDepartureTransportMeans) 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 DEXPDDHeaderDepartureTransportMeans) 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 DEXPDDHeaderDepartureTransportMeans Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDHeaderDepartureTransportMeansType ''' _ Item10 ''' _ Item20 ''' _ Item31 ''' _ Item32 ''' _ Item33 ''' _ Item34 ''' _ Item35 ''' _ Item40 ''' _ Item50 ''' _ Item60 ''' _ Item70 End Enum _ Partial Public Class DEXPDDHeaderBorderTransportMeans #Region "Private fields" Private _mode As String Private _type As DEXPDDHeaderBorderTransportMeansType Private _identity As String Private _nationality As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property Mode() As String Get Return Me._mode End Get Set(value As String) Me._mode = Value End Set End Property Public Property Type() As DEXPDDHeaderBorderTransportMeansType Get Return Me._type End Get Set(value As DEXPDDHeaderBorderTransportMeansType) Me._type = Value End Set End Property _ Public Property Identity() As String Get Return Me._identity End Get Set(value As String) Me._identity = Value End Set End Property _ Public Property Nationality() As String Get Return Me._nationality End Get Set(value As String) Me._nationality = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDHeaderBorderTransportMeans)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDHeaderBorderTransportMeans object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDHeaderBorderTransportMeans object ''' ''' string workflow markup to deserialize ''' Output DEXPDDHeaderBorderTransportMeans 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 DEXPDDHeaderBorderTransportMeans, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDHeaderBorderTransportMeans) 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 DEXPDDHeaderBorderTransportMeans) 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 DEXPDDHeaderBorderTransportMeans Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDHeaderBorderTransportMeans) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDHeaderBorderTransportMeans Return CType(Serializer.Deserialize(s), DEXPDDHeaderBorderTransportMeans) End Function #End Region ''' ''' Serializes current DEXPDDHeaderBorderTransportMeans object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDHeaderBorderTransportMeans object ''' ''' string xml file to load and deserialize ''' Output DEXPDDHeaderBorderTransportMeans 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 DEXPDDHeaderBorderTransportMeans, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDHeaderBorderTransportMeans) 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 DEXPDDHeaderBorderTransportMeans) 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 DEXPDDHeaderBorderTransportMeans Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDHeaderBorderTransportMeansType ''' _ Item10 ''' _ Item20 ''' _ Item31 ''' _ Item32 ''' _ Item33 ''' _ Item34 ''' _ Item35 ''' _ Item40 ''' _ Item50 ''' _ Item60 ''' _ Item70 End Enum _ Partial Public Class DEXPDDGoodsLoadingPlace #Region "Private fields" Private _identification As DEXPDDGoodsLoadingPlaceIdentification Private _address As DEXPDDGoodsLoadingPlaceAddress Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._address = New DEXPDDGoodsLoadingPlaceAddress() Me._identification = New DEXPDDGoodsLoadingPlaceIdentification() End Sub Public Property Identification() As DEXPDDGoodsLoadingPlaceIdentification Get Return Me._identification End Get Set(value As DEXPDDGoodsLoadingPlaceIdentification) Me._identification = Value End Set End Property Public Property Address() As DEXPDDGoodsLoadingPlaceAddress Get Return Me._address End Get Set(value As DEXPDDGoodsLoadingPlaceAddress) Me._address = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsLoadingPlace)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsLoadingPlace object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsLoadingPlace object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsLoadingPlace 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 DEXPDDGoodsLoadingPlace, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsLoadingPlace) 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 DEXPDDGoodsLoadingPlace) 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 DEXPDDGoodsLoadingPlace Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsLoadingPlace) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsLoadingPlace Return CType(Serializer.Deserialize(s), DEXPDDGoodsLoadingPlace) End Function #End Region ''' ''' Serializes current DEXPDDGoodsLoadingPlace object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsLoadingPlace object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsLoadingPlace 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 DEXPDDGoodsLoadingPlace, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsLoadingPlace) 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 DEXPDDGoodsLoadingPlace) 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 DEXPDDGoodsLoadingPlace Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDGoodsLoadingPlaceIdentification #Region "Private fields" Private _referenceNumber As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set(value As String) Me._referenceNumber = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsLoadingPlaceIdentification)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsLoadingPlaceIdentification object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsLoadingPlaceIdentification object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsLoadingPlaceIdentification 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 DEXPDDGoodsLoadingPlaceIdentification, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsLoadingPlaceIdentification) 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 DEXPDDGoodsLoadingPlaceIdentification) 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 DEXPDDGoodsLoadingPlaceIdentification Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsLoadingPlaceIdentification) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsLoadingPlaceIdentification Return CType(Serializer.Deserialize(s), DEXPDDGoodsLoadingPlaceIdentification) End Function #End Region ''' ''' Serializes current DEXPDDGoodsLoadingPlaceIdentification object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsLoadingPlaceIdentification object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsLoadingPlaceIdentification 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 DEXPDDGoodsLoadingPlaceIdentification, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsLoadingPlaceIdentification) 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 DEXPDDGoodsLoadingPlaceIdentification) 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 DEXPDDGoodsLoadingPlaceIdentification Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDGoodsLoadingPlaceAddress #Region "Private fields" Private _line As String Private _postcode As String Private _city As String Private _complement As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property Line() As String Get Return Me._line End Get Set(value As String) Me._line = Value End Set End Property _ Public Property Postcode() As String Get Return Me._postcode End Get Set(value As String) Me._postcode = Value End Set End Property _ Public Property City() As String Get Return Me._city End Get Set(value As String) Me._city = Value End Set End Property _ Public Property Complement() As String Get Return Me._complement End Get Set(value As String) Me._complement = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsLoadingPlaceAddress)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsLoadingPlaceAddress object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsLoadingPlaceAddress object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsLoadingPlaceAddress 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 DEXPDDGoodsLoadingPlaceAddress, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsLoadingPlaceAddress) 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 DEXPDDGoodsLoadingPlaceAddress) 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 DEXPDDGoodsLoadingPlaceAddress Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsLoadingPlaceAddress) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsLoadingPlaceAddress Return CType(Serializer.Deserialize(s), DEXPDDGoodsLoadingPlaceAddress) End Function #End Region ''' ''' Serializes current DEXPDDGoodsLoadingPlaceAddress object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsLoadingPlaceAddress object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsLoadingPlaceAddress 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 DEXPDDGoodsLoadingPlaceAddress, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsLoadingPlaceAddress) 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 DEXPDDGoodsLoadingPlaceAddress) 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 DEXPDDGoodsLoadingPlaceAddress Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDExportCustomsOffice #Region "Private fields" Private _referenceNumber As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set(value As String) Me._referenceNumber = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDExportCustomsOffice)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDExportCustomsOffice object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDExportCustomsOffice object ''' ''' string workflow markup to deserialize ''' Output DEXPDDExportCustomsOffice 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 DEXPDDExportCustomsOffice, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDExportCustomsOffice) 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 DEXPDDExportCustomsOffice) 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 DEXPDDExportCustomsOffice Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDExportCustomsOffice) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDExportCustomsOffice Return CType(Serializer.Deserialize(s), DEXPDDExportCustomsOffice) End Function #End Region ''' ''' Serializes current DEXPDDExportCustomsOffice object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDExportCustomsOffice object ''' ''' string xml file to load and deserialize ''' Output DEXPDDExportCustomsOffice 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 DEXPDDExportCustomsOffice, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDExportCustomsOffice) 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 DEXPDDExportCustomsOffice) 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 DEXPDDExportCustomsOffice Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDSupplementaryDeclarationCustomsOffice #Region "Private fields" Private _referenceNumber As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set(value As String) Me._referenceNumber = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDSupplementaryDeclarationCustomsOffice)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDSupplementaryDeclarationCustomsOffice object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDSupplementaryDeclarationCustomsOffice object ''' ''' string workflow markup to deserialize ''' Output DEXPDDSupplementaryDeclarationCustomsOffice 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 DEXPDDSupplementaryDeclarationCustomsOffice, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDSupplementaryDeclarationCustomsOffice) 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 DEXPDDSupplementaryDeclarationCustomsOffice) 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 DEXPDDSupplementaryDeclarationCustomsOffice Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDSupplementaryDeclarationCustomsOffice) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDSupplementaryDeclarationCustomsOffice Return CType(Serializer.Deserialize(s), DEXPDDSupplementaryDeclarationCustomsOffice) End Function #End Region ''' ''' Serializes current DEXPDDSupplementaryDeclarationCustomsOffice object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDSupplementaryDeclarationCustomsOffice object ''' ''' string xml file to load and deserialize ''' Output DEXPDDSupplementaryDeclarationCustomsOffice 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 DEXPDDSupplementaryDeclarationCustomsOffice, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDSupplementaryDeclarationCustomsOffice) 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 DEXPDDSupplementaryDeclarationCustomsOffice) 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 DEXPDDSupplementaryDeclarationCustomsOffice Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDIntendedExitCustomsOffice #Region "Private fields" Private _referenceNumber As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set(value As String) Me._referenceNumber = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDIntendedExitCustomsOffice)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDIntendedExitCustomsOffice object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDIntendedExitCustomsOffice object ''' ''' string workflow markup to deserialize ''' Output DEXPDDIntendedExitCustomsOffice 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 DEXPDDIntendedExitCustomsOffice, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDIntendedExitCustomsOffice) 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 DEXPDDIntendedExitCustomsOffice) 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 DEXPDDIntendedExitCustomsOffice Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDIntendedExitCustomsOffice) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDIntendedExitCustomsOffice Return CType(Serializer.Deserialize(s), DEXPDDIntendedExitCustomsOffice) End Function #End Region ''' ''' Serializes current DEXPDDIntendedExitCustomsOffice object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDIntendedExitCustomsOffice object ''' ''' string xml file to load and deserialize ''' Output DEXPDDIntendedExitCustomsOffice 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 DEXPDDIntendedExitCustomsOffice, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDIntendedExitCustomsOffice) 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 DEXPDDIntendedExitCustomsOffice) 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 DEXPDDIntendedExitCustomsOffice Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDActualExitCustomsOffice #Region "Private fields" Private _referenceNumber As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set(value As String) Me._referenceNumber = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDActualExitCustomsOffice)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDActualExitCustomsOffice object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDActualExitCustomsOffice object ''' ''' string workflow markup to deserialize ''' Output DEXPDDActualExitCustomsOffice 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 DEXPDDActualExitCustomsOffice, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDActualExitCustomsOffice) 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 DEXPDDActualExitCustomsOffice) 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 DEXPDDActualExitCustomsOffice Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDActualExitCustomsOffice) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDActualExitCustomsOffice Return CType(Serializer.Deserialize(s), DEXPDDActualExitCustomsOffice) End Function #End Region ''' ''' Serializes current DEXPDDActualExitCustomsOffice object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDActualExitCustomsOffice object ''' ''' string xml file to load and deserialize ''' Output DEXPDDActualExitCustomsOffice 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 DEXPDDActualExitCustomsOffice, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDActualExitCustomsOffice) 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 DEXPDDActualExitCustomsOffice) 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 DEXPDDActualExitCustomsOffice Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDTransaction #Region "Private fields" Private _type As DEXPDDTransactionType Private _invoiceAmount As Decimal Private _currency As String Private Shared sSerializer As XmlSerializer #End Region Public Property Type() As DEXPDDTransactionType Get Return Me._type End Get Set(value As DEXPDDTransactionType) Me._type = Value End Set End Property Public Property InvoiceAmount() As Decimal Get Return Me._invoiceAmount End Get Set(value As Decimal) Me._invoiceAmount = Value End Set End Property _ Public Property Currency() As String Get Return Me._currency End Get Set(value As String) Me._currency = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDTransaction)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDTransaction object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDTransaction object ''' ''' string workflow markup to deserialize ''' Output DEXPDDTransaction 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 DEXPDDTransaction, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDTransaction) 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 DEXPDDTransaction) 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 DEXPDDTransaction Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDTransaction) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDTransaction Return CType(Serializer.Deserialize(s), DEXPDDTransaction) End Function #End Region ''' ''' Serializes current DEXPDDTransaction object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDTransaction object ''' ''' string xml file to load and deserialize ''' Output DEXPDDTransaction 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 DEXPDDTransaction, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDTransaction) 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 DEXPDDTransaction) 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 DEXPDDTransaction Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDTransactionType ''' _ Item11 ''' _ Item12 ''' _ Item13 ''' _ Item14 ''' _ Item19 ''' _ Item21 ''' _ Item22 ''' _ Item23 ''' _ Item29 ''' _ Item31 ''' _ Item32 ''' _ Item33 ''' _ Item34 ''' _ Item41 ''' _ Item42 ''' _ Item51 ''' _ Item52 ''' _ Item67 ''' _ Item69 ''' _ Item71 ''' _ Item72 ''' _ Item81 ''' _ Item91 ''' _ Item92 ''' _ Item99 End Enum _ Partial Public Class DEXPDDSpecialFact #Region "Private fields" Private _indicator As DEXPDDSpecialFactIndicator Private Shared sSerializer As XmlSerializer #End Region Public Property Indicator() As DEXPDDSpecialFactIndicator Get Return Me._indicator End Get Set(value As DEXPDDSpecialFactIndicator) Me._indicator = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDSpecialFact)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDSpecialFact object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDSpecialFact object ''' ''' string workflow markup to deserialize ''' Output DEXPDDSpecialFact 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 DEXPDDSpecialFact, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDSpecialFact) 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 DEXPDDSpecialFact) 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 DEXPDDSpecialFact Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDSpecialFact) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDSpecialFact Return CType(Serializer.Deserialize(s), DEXPDDSpecialFact) End Function #End Region ''' ''' Serializes current DEXPDDSpecialFact object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDSpecialFact object ''' ''' string xml file to load and deserialize ''' Output DEXPDDSpecialFact 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 DEXPDDSpecialFact, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDSpecialFact) 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 DEXPDDSpecialFact) 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 DEXPDDSpecialFact Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDSpecialFactIndicator ''' _ Item0 ''' _ Item1 ''' _ Item2 ''' _ Item3 ''' _ Item4 ''' _ Item5 End Enum _ Partial Public Class DEXPDDItinerary #Region "Private fields" Private _country As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property Country() As String Get Return Me._country End Get Set(value As String) Me._country = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDItinerary)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDItinerary object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDItinerary object ''' ''' string workflow markup to deserialize ''' Output DEXPDDItinerary 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 DEXPDDItinerary, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDItinerary) 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 DEXPDDItinerary) 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 DEXPDDItinerary Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDItinerary) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDItinerary Return CType(Serializer.Deserialize(s), DEXPDDItinerary) End Function #End Region ''' ''' Serializes current DEXPDDItinerary object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDItinerary object ''' ''' string xml file to load and deserialize ''' Output DEXPDDItinerary 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 DEXPDDItinerary, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDItinerary) 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 DEXPDDItinerary) 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 DEXPDDItinerary Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDSeals #Region "Private fields" Private _type As DEXPDDSealsType Private _number As String Private _seal As List(Of DEXPDDSealsSeal) Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._seal = New List(Of DEXPDDSealsSeal)() End Sub Public Property Type() As DEXPDDSealsType Get Return Me._type End Get Set(value As DEXPDDSealsType) Me._type = Value End Set End Property _ Public Property Number() As String Get Return Me._number End Get Set(value As String) Me._number = Value End Set End Property _ Public Property Seal() As List(Of DEXPDDSealsSeal) Get Return Me._seal End Get Set(value As List(Of DEXPDDSealsSeal)) Me._seal = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDSeals)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDSeals object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDSeals object ''' ''' string workflow markup to deserialize ''' Output DEXPDDSeals 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 DEXPDDSeals, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDSeals) 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 DEXPDDSeals) 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 DEXPDDSeals Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDSeals) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDSeals Return CType(Serializer.Deserialize(s), DEXPDDSeals) End Function #End Region ''' ''' Serializes current DEXPDDSeals object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDSeals object ''' ''' string xml file to load and deserialize ''' Output DEXPDDSeals 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 DEXPDDSeals, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDSeals) 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 DEXPDDSeals) 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 DEXPDDSeals Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDSealsType ''' P ''' R End Enum _ Partial Public Class DEXPDDSealsSeal #Region "Private fields" Private _identity As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property Identity() As String Get Return Me._identity End Get Set(value As String) Me._identity = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDSealsSeal)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDSealsSeal object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDSealsSeal object ''' ''' string workflow markup to deserialize ''' Output DEXPDDSealsSeal 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 DEXPDDSealsSeal, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDSealsSeal) 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 DEXPDDSealsSeal) 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 DEXPDDSealsSeal Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDSealsSeal) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDSealsSeal Return CType(Serializer.Deserialize(s), DEXPDDSealsSeal) End Function #End Region ''' ''' Serializes current DEXPDDSealsSeal object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDSealsSeal object ''' ''' string xml file to load and deserialize ''' Output DEXPDDSealsSeal 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 DEXPDDSealsSeal, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDSealsSeal) 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 DEXPDDSealsSeal) 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 DEXPDDSealsSeal Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDPresentationPackingLoading #Region "Private fields" Private _startDateTime As Date Private _endDateTime As Date Private Shared sSerializer As XmlSerializer #End Region Public Property StartDateTime() As Date Get Return Me._startDateTime End Get Set(value As Date) Me._startDateTime = Value End Set End Property Public Property EndDateTime() As Date Get Return Me._endDateTime End Get Set(value As Date) Me._endDateTime = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDPresentationPackingLoading)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDPresentationPackingLoading object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDPresentationPackingLoading object ''' ''' string workflow markup to deserialize ''' Output DEXPDDPresentationPackingLoading 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 DEXPDDPresentationPackingLoading, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDPresentationPackingLoading) 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 DEXPDDPresentationPackingLoading) 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 DEXPDDPresentationPackingLoading Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDPresentationPackingLoading) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDPresentationPackingLoading Return CType(Serializer.Deserialize(s), DEXPDDPresentationPackingLoading) End Function #End Region ''' ''' Serializes current DEXPDDPresentationPackingLoading object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDPresentationPackingLoading object ''' ''' string xml file to load and deserialize ''' Output DEXPDDPresentationPackingLoading 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 DEXPDDPresentationPackingLoading, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDPresentationPackingLoading) 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 DEXPDDPresentationPackingLoading) 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 DEXPDDPresentationPackingLoading Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDExporter #Region "Private fields" Private _class As DEXPDDExporterClass Private _identification As DEXPDDExporterIdentification Private _name As String Private _address As DEXPDDExporterAddress Private _contactPerson As DEXPDDExporterContactPerson Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._contactPerson = New DEXPDDExporterContactPerson() Me._address = New DEXPDDExporterAddress() Me._identification = New DEXPDDExporterIdentification() End Sub Public Property [Class]() As DEXPDDExporterClass Get Return Me._class End Get Set(value As DEXPDDExporterClass) Me._class = Value End Set End Property Public Property Identification() As DEXPDDExporterIdentification Get Return Me._identification End Get Set(value As DEXPDDExporterIdentification) Me._identification = Value End Set End Property _ Public Property Name() As String Get Return Me._name End Get Set(value As String) Me._name = Value End Set End Property Public Property Address() As DEXPDDExporterAddress Get Return Me._address End Get Set(value As DEXPDDExporterAddress) Me._address = Value End Set End Property Public Property ContactPerson() As DEXPDDExporterContactPerson Get Return Me._contactPerson End Get Set(value As DEXPDDExporterContactPerson) Me._contactPerson = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDExporter)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDExporter object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDExporter object ''' ''' string workflow markup to deserialize ''' Output DEXPDDExporter 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 DEXPDDExporter, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDExporter) 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 DEXPDDExporter) 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 DEXPDDExporter Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDExporter) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDExporter Return CType(Serializer.Deserialize(s), DEXPDDExporter) End Function #End Region ''' ''' Serializes current DEXPDDExporter object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDExporter object ''' ''' string xml file to load and deserialize ''' Output DEXPDDExporter 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 DEXPDDExporter, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDExporter) 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 DEXPDDExporter) 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 DEXPDDExporter Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDExporterClass ''' _ Item0 ''' _ Item2 ''' _ Item4 End Enum _ Partial Public Class DEXPDDExporterIdentification #Region "Private fields" Private _referenceNumber As String Private _subsidiaryNumber As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set(value As String) Me._referenceNumber = Value End Set End Property _ Public Property SubsidiaryNumber() As String Get Return Me._subsidiaryNumber End Get Set(value As String) Me._subsidiaryNumber = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDExporterIdentification)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDExporterIdentification object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDExporterIdentification object ''' ''' string workflow markup to deserialize ''' Output DEXPDDExporterIdentification 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 DEXPDDExporterIdentification, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDExporterIdentification) 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 DEXPDDExporterIdentification) 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 DEXPDDExporterIdentification Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDExporterIdentification) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDExporterIdentification Return CType(Serializer.Deserialize(s), DEXPDDExporterIdentification) End Function #End Region ''' ''' Serializes current DEXPDDExporterIdentification object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDExporterIdentification object ''' ''' string xml file to load and deserialize ''' Output DEXPDDExporterIdentification 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 DEXPDDExporterIdentification, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDExporterIdentification) 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 DEXPDDExporterIdentification) 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 DEXPDDExporterIdentification Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDExporterAddress #Region "Private fields" Private _line As String Private _city As String Private _postcode As String Private _country As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property Line() As String Get Return Me._line End Get Set(value As String) Me._line = Value End Set End Property _ Public Property City() As String Get Return Me._city End Get Set(value As String) Me._city = Value End Set End Property _ Public Property Postcode() As String Get Return Me._postcode End Get Set(value As String) Me._postcode = Value End Set End Property _ Public Property Country() As String Get Return Me._country End Get Set(value As String) Me._country = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDExporterAddress)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDExporterAddress object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDExporterAddress object ''' ''' string workflow markup to deserialize ''' Output DEXPDDExporterAddress 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 DEXPDDExporterAddress, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDExporterAddress) 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 DEXPDDExporterAddress) 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 DEXPDDExporterAddress Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDExporterAddress) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDExporterAddress Return CType(Serializer.Deserialize(s), DEXPDDExporterAddress) End Function #End Region ''' ''' Serializes current DEXPDDExporterAddress object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDExporterAddress object ''' ''' string xml file to load and deserialize ''' Output DEXPDDExporterAddress 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 DEXPDDExporterAddress, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDExporterAddress) 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 DEXPDDExporterAddress) 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 DEXPDDExporterAddress Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDExporterContactPerson #Region "Private fields" Private _position As String Private _name As String Private _phoneNumber As String Private _facsimileNumber As String Private _mailAddress As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property Position() As String Get Return Me._position End Get Set(value As String) Me._position = Value End Set End Property _ Public Property Name() As String Get Return Me._name End Get Set(value As String) Me._name = Value End Set End Property _ Public Property PhoneNumber() As String Get Return Me._phoneNumber End Get Set(value As String) Me._phoneNumber = Value End Set End Property _ Public Property FacsimileNumber() As String Get Return Me._facsimileNumber End Get Set(value As String) Me._facsimileNumber = Value End Set End Property _ Public Property MailAddress() As String Get Return Me._mailAddress End Get Set(value As String) Me._mailAddress = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDExporterContactPerson)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDExporterContactPerson object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDExporterContactPerson object ''' ''' string workflow markup to deserialize ''' Output DEXPDDExporterContactPerson 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 DEXPDDExporterContactPerson, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDExporterContactPerson) 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 DEXPDDExporterContactPerson) 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 DEXPDDExporterContactPerson Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDExporterContactPerson) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDExporterContactPerson Return CType(Serializer.Deserialize(s), DEXPDDExporterContactPerson) End Function #End Region ''' ''' Serializes current DEXPDDExporterContactPerson object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDExporterContactPerson object ''' ''' string xml file to load and deserialize ''' Output DEXPDDExporterContactPerson 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 DEXPDDExporterContactPerson, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDExporterContactPerson) 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 DEXPDDExporterContactPerson) 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 DEXPDDExporterContactPerson Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDDeclarant #Region "Private fields" Private _class As DEXPDDDeclarantClass Private _identification As DEXPDDDeclarantIdentification Private _name As String Private _address As DEXPDDDeclarantAddress Private _contactPerson As DEXPDDDeclarantContactPerson Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._contactPerson = New DEXPDDDeclarantContactPerson() Me._address = New DEXPDDDeclarantAddress() Me._identification = New DEXPDDDeclarantIdentification() End Sub Public Property [Class]() As DEXPDDDeclarantClass Get Return Me._class End Get Set(value As DEXPDDDeclarantClass) Me._class = Value End Set End Property Public Property Identification() As DEXPDDDeclarantIdentification Get Return Me._identification End Get Set(value As DEXPDDDeclarantIdentification) Me._identification = Value End Set End Property _ Public Property Name() As String Get Return Me._name End Get Set(value As String) Me._name = Value End Set End Property Public Property Address() As DEXPDDDeclarantAddress Get Return Me._address End Get Set(value As DEXPDDDeclarantAddress) Me._address = Value End Set End Property Public Property ContactPerson() As DEXPDDDeclarantContactPerson Get Return Me._contactPerson End Get Set(value As DEXPDDDeclarantContactPerson) Me._contactPerson = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDDeclarant)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDDeclarant object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDDeclarant object ''' ''' string workflow markup to deserialize ''' Output DEXPDDDeclarant 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 DEXPDDDeclarant, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDDeclarant) 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 DEXPDDDeclarant) 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 DEXPDDDeclarant Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDDeclarant) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDDeclarant Return CType(Serializer.Deserialize(s), DEXPDDDeclarant) End Function #End Region ''' ''' Serializes current DEXPDDDeclarant object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDDeclarant object ''' ''' string xml file to load and deserialize ''' Output DEXPDDDeclarant 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 DEXPDDDeclarant, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDDeclarant) 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 DEXPDDDeclarant) 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 DEXPDDDeclarant Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDDeclarantClass ''' _ Item0 ''' _ Item2 End Enum _ Partial Public Class DEXPDDDeclarantIdentification #Region "Private fields" Private _referenceNumber As String Private _subsidiaryNumber As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set(value As String) Me._referenceNumber = Value End Set End Property _ Public Property SubsidiaryNumber() As String Get Return Me._subsidiaryNumber End Get Set(value As String) Me._subsidiaryNumber = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDDeclarantIdentification)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDDeclarantIdentification object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDDeclarantIdentification object ''' ''' string workflow markup to deserialize ''' Output DEXPDDDeclarantIdentification 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 DEXPDDDeclarantIdentification, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDDeclarantIdentification) 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 DEXPDDDeclarantIdentification) 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 DEXPDDDeclarantIdentification Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDDeclarantIdentification) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDDeclarantIdentification Return CType(Serializer.Deserialize(s), DEXPDDDeclarantIdentification) End Function #End Region ''' ''' Serializes current DEXPDDDeclarantIdentification object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDDeclarantIdentification object ''' ''' string xml file to load and deserialize ''' Output DEXPDDDeclarantIdentification 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 DEXPDDDeclarantIdentification, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDDeclarantIdentification) 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 DEXPDDDeclarantIdentification) 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 DEXPDDDeclarantIdentification Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDDeclarantAddress #Region "Private fields" Private _line As String Private _city As String Private _postcode As String Private _country As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property Line() As String Get Return Me._line End Get Set(value As String) Me._line = Value End Set End Property _ Public Property City() As String Get Return Me._city End Get Set(value As String) Me._city = Value End Set End Property _ Public Property Postcode() As String Get Return Me._postcode End Get Set(value As String) Me._postcode = Value End Set End Property _ Public Property Country() As String Get Return Me._country End Get Set(value As String) Me._country = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDDeclarantAddress)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDDeclarantAddress object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDDeclarantAddress object ''' ''' string workflow markup to deserialize ''' Output DEXPDDDeclarantAddress 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 DEXPDDDeclarantAddress, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDDeclarantAddress) 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 DEXPDDDeclarantAddress) 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 DEXPDDDeclarantAddress Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDDeclarantAddress) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDDeclarantAddress Return CType(Serializer.Deserialize(s), DEXPDDDeclarantAddress) End Function #End Region ''' ''' Serializes current DEXPDDDeclarantAddress object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDDeclarantAddress object ''' ''' string xml file to load and deserialize ''' Output DEXPDDDeclarantAddress 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 DEXPDDDeclarantAddress, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDDeclarantAddress) 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 DEXPDDDeclarantAddress) 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 DEXPDDDeclarantAddress Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDDeclarantContactPerson #Region "Private fields" Private _position As String Private _name As String Private _phoneNumber As String Private _facsimileNumber As String Private _mailAddress As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property Position() As String Get Return Me._position End Get Set(value As String) Me._position = Value End Set End Property _ Public Property Name() As String Get Return Me._name End Get Set(value As String) Me._name = Value End Set End Property _ Public Property PhoneNumber() As String Get Return Me._phoneNumber End Get Set(value As String) Me._phoneNumber = Value End Set End Property _ Public Property FacsimileNumber() As String Get Return Me._facsimileNumber End Get Set(value As String) Me._facsimileNumber = Value End Set End Property _ Public Property MailAddress() As String Get Return Me._mailAddress End Get Set(value As String) Me._mailAddress = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDDeclarantContactPerson)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDDeclarantContactPerson object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDDeclarantContactPerson object ''' ''' string workflow markup to deserialize ''' Output DEXPDDDeclarantContactPerson 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 DEXPDDDeclarantContactPerson, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDDeclarantContactPerson) 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 DEXPDDDeclarantContactPerson) 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 DEXPDDDeclarantContactPerson Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDDeclarantContactPerson) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDDeclarantContactPerson Return CType(Serializer.Deserialize(s), DEXPDDDeclarantContactPerson) End Function #End Region ''' ''' Serializes current DEXPDDDeclarantContactPerson object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDDeclarantContactPerson object ''' ''' string xml file to load and deserialize ''' Output DEXPDDDeclarantContactPerson 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 DEXPDDDeclarantContactPerson, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDDeclarantContactPerson) 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 DEXPDDDeclarantContactPerson) 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 DEXPDDDeclarantContactPerson Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDRepresentative #Region "Private fields" Private _class As DEXPDDRepresentativeClass Private _identification As DEXPDDRepresentativeIdentification Private _name As String Private _address As DEXPDDRepresentativeAddress Private _contactPerson As DEXPDDRepresentativeContactPerson Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._contactPerson = New DEXPDDRepresentativeContactPerson() Me._address = New DEXPDDRepresentativeAddress() Me._identification = New DEXPDDRepresentativeIdentification() End Sub Public Property [Class]() As DEXPDDRepresentativeClass Get Return Me._class End Get Set(value As DEXPDDRepresentativeClass) Me._class = Value End Set End Property Public Property Identification() As DEXPDDRepresentativeIdentification Get Return Me._identification End Get Set(value As DEXPDDRepresentativeIdentification) Me._identification = Value End Set End Property _ Public Property Name() As String Get Return Me._name End Get Set(value As String) Me._name = Value End Set End Property Public Property Address() As DEXPDDRepresentativeAddress Get Return Me._address End Get Set(value As DEXPDDRepresentativeAddress) Me._address = Value End Set End Property Public Property ContactPerson() As DEXPDDRepresentativeContactPerson Get Return Me._contactPerson End Get Set(value As DEXPDDRepresentativeContactPerson) Me._contactPerson = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDRepresentative)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDRepresentative object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDRepresentative object ''' ''' string workflow markup to deserialize ''' Output DEXPDDRepresentative 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 DEXPDDRepresentative, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDRepresentative) 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 DEXPDDRepresentative) 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 DEXPDDRepresentative Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDRepresentative) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDRepresentative Return CType(Serializer.Deserialize(s), DEXPDDRepresentative) End Function #End Region ''' ''' Serializes current DEXPDDRepresentative object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDRepresentative object ''' ''' string xml file to load and deserialize ''' Output DEXPDDRepresentative 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 DEXPDDRepresentative, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDRepresentative) 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 DEXPDDRepresentative) 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 DEXPDDRepresentative Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDRepresentativeClass ''' _ Item0 ''' _ Item2 End Enum _ Partial Public Class DEXPDDRepresentativeIdentification #Region "Private fields" Private _referenceNumber As String Private _subsidiaryNumber As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set(value As String) Me._referenceNumber = Value End Set End Property _ Public Property SubsidiaryNumber() As String Get Return Me._subsidiaryNumber End Get Set(value As String) Me._subsidiaryNumber = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDRepresentativeIdentification)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDRepresentativeIdentification object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDRepresentativeIdentification object ''' ''' string workflow markup to deserialize ''' Output DEXPDDRepresentativeIdentification 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 DEXPDDRepresentativeIdentification, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDRepresentativeIdentification) 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 DEXPDDRepresentativeIdentification) 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 DEXPDDRepresentativeIdentification Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDRepresentativeIdentification) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDRepresentativeIdentification Return CType(Serializer.Deserialize(s), DEXPDDRepresentativeIdentification) End Function #End Region ''' ''' Serializes current DEXPDDRepresentativeIdentification object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDRepresentativeIdentification object ''' ''' string xml file to load and deserialize ''' Output DEXPDDRepresentativeIdentification 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 DEXPDDRepresentativeIdentification, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDRepresentativeIdentification) 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 DEXPDDRepresentativeIdentification) 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 DEXPDDRepresentativeIdentification Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDRepresentativeAddress #Region "Private fields" Private _line As String Private _city As String Private _postcode As String Private _country As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property Line() As String Get Return Me._line End Get Set(value As String) Me._line = Value End Set End Property _ Public Property City() As String Get Return Me._city End Get Set(value As String) Me._city = Value End Set End Property _ Public Property Postcode() As String Get Return Me._postcode End Get Set(value As String) Me._postcode = Value End Set End Property _ Public Property Country() As String Get Return Me._country End Get Set(value As String) Me._country = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDRepresentativeAddress)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDRepresentativeAddress object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDRepresentativeAddress object ''' ''' string workflow markup to deserialize ''' Output DEXPDDRepresentativeAddress 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 DEXPDDRepresentativeAddress, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDRepresentativeAddress) 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 DEXPDDRepresentativeAddress) 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 DEXPDDRepresentativeAddress Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDRepresentativeAddress) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDRepresentativeAddress Return CType(Serializer.Deserialize(s), DEXPDDRepresentativeAddress) End Function #End Region ''' ''' Serializes current DEXPDDRepresentativeAddress object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDRepresentativeAddress object ''' ''' string xml file to load and deserialize ''' Output DEXPDDRepresentativeAddress 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 DEXPDDRepresentativeAddress, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDRepresentativeAddress) 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 DEXPDDRepresentativeAddress) 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 DEXPDDRepresentativeAddress Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDRepresentativeContactPerson #Region "Private fields" Private _position As String Private _name As String Private _phoneNumber As String Private _facsimileNumber As String Private _mailAddress As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property Position() As String Get Return Me._position End Get Set(value As String) Me._position = Value End Set End Property _ Public Property Name() As String Get Return Me._name End Get Set(value As String) Me._name = Value End Set End Property _ Public Property PhoneNumber() As String Get Return Me._phoneNumber End Get Set(value As String) Me._phoneNumber = Value End Set End Property _ Public Property FacsimileNumber() As String Get Return Me._facsimileNumber End Get Set(value As String) Me._facsimileNumber = Value End Set End Property _ Public Property MailAddress() As String Get Return Me._mailAddress End Get Set(value As String) Me._mailAddress = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDRepresentativeContactPerson)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDRepresentativeContactPerson object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDRepresentativeContactPerson object ''' ''' string workflow markup to deserialize ''' Output DEXPDDRepresentativeContactPerson 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 DEXPDDRepresentativeContactPerson, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDRepresentativeContactPerson) 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 DEXPDDRepresentativeContactPerson) 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 DEXPDDRepresentativeContactPerson Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDRepresentativeContactPerson) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDRepresentativeContactPerson Return CType(Serializer.Deserialize(s), DEXPDDRepresentativeContactPerson) End Function #End Region ''' ''' Serializes current DEXPDDRepresentativeContactPerson object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDRepresentativeContactPerson object ''' ''' string xml file to load and deserialize ''' Output DEXPDDRepresentativeContactPerson 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 DEXPDDRepresentativeContactPerson, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDRepresentativeContactPerson) 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 DEXPDDRepresentativeContactPerson) 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 DEXPDDRepresentativeContactPerson Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDContractor #Region "Private fields" Private _class As DEXPDDContractorClass Private _identification As DEXPDDContractorIdentification Private _name As String Private _address As DEXPDDContractorAddress Private _contactPerson As DEXPDDContractorContactPerson Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._contactPerson = New DEXPDDContractorContactPerson() Me._address = New DEXPDDContractorAddress() Me._identification = New DEXPDDContractorIdentification() End Sub Public Property [Class]() As DEXPDDContractorClass Get Return Me._class End Get Set(value As DEXPDDContractorClass) Me._class = Value End Set End Property Public Property Identification() As DEXPDDContractorIdentification Get Return Me._identification End Get Set(value As DEXPDDContractorIdentification) Me._identification = Value End Set End Property _ Public Property Name() As String Get Return Me._name End Get Set(value As String) Me._name = Value End Set End Property Public Property Address() As DEXPDDContractorAddress Get Return Me._address End Get Set(value As DEXPDDContractorAddress) Me._address = Value End Set End Property Public Property ContactPerson() As DEXPDDContractorContactPerson Get Return Me._contactPerson End Get Set(value As DEXPDDContractorContactPerson) Me._contactPerson = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDContractor)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDContractor object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDContractor object ''' ''' string workflow markup to deserialize ''' Output DEXPDDContractor 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 DEXPDDContractor, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDContractor) 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 DEXPDDContractor) 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 DEXPDDContractor Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDContractor) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDContractor Return CType(Serializer.Deserialize(s), DEXPDDContractor) End Function #End Region ''' ''' Serializes current DEXPDDContractor object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDContractor object ''' ''' string xml file to load and deserialize ''' Output DEXPDDContractor 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 DEXPDDContractor, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDContractor) 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 DEXPDDContractor) 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 DEXPDDContractor Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDContractorClass ''' _ Item0 ''' _ Item2 End Enum _ Partial Public Class DEXPDDContractorIdentification #Region "Private fields" Private _referenceNumber As String Private _subsidiaryNumber As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set(value As String) Me._referenceNumber = Value End Set End Property _ Public Property SubsidiaryNumber() As String Get Return Me._subsidiaryNumber End Get Set(value As String) Me._subsidiaryNumber = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDContractorIdentification)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDContractorIdentification object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDContractorIdentification object ''' ''' string workflow markup to deserialize ''' Output DEXPDDContractorIdentification 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 DEXPDDContractorIdentification, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDContractorIdentification) 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 DEXPDDContractorIdentification) 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 DEXPDDContractorIdentification Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDContractorIdentification) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDContractorIdentification Return CType(Serializer.Deserialize(s), DEXPDDContractorIdentification) End Function #End Region ''' ''' Serializes current DEXPDDContractorIdentification object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDContractorIdentification object ''' ''' string xml file to load and deserialize ''' Output DEXPDDContractorIdentification 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 DEXPDDContractorIdentification, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDContractorIdentification) 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 DEXPDDContractorIdentification) 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 DEXPDDContractorIdentification Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDContractorAddress #Region "Private fields" Private _line As String Private _city As String Private _postcode As String Private _country As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property Line() As String Get Return Me._line End Get Set(value As String) Me._line = Value End Set End Property _ Public Property City() As String Get Return Me._city End Get Set(value As String) Me._city = Value End Set End Property _ Public Property Postcode() As String Get Return Me._postcode End Get Set(value As String) Me._postcode = Value End Set End Property _ Public Property Country() As String Get Return Me._country End Get Set(value As String) Me._country = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDContractorAddress)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDContractorAddress object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDContractorAddress object ''' ''' string workflow markup to deserialize ''' Output DEXPDDContractorAddress 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 DEXPDDContractorAddress, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDContractorAddress) 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 DEXPDDContractorAddress) 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 DEXPDDContractorAddress Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDContractorAddress) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDContractorAddress Return CType(Serializer.Deserialize(s), DEXPDDContractorAddress) End Function #End Region ''' ''' Serializes current DEXPDDContractorAddress object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDContractorAddress object ''' ''' string xml file to load and deserialize ''' Output DEXPDDContractorAddress 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 DEXPDDContractorAddress, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDContractorAddress) 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 DEXPDDContractorAddress) 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 DEXPDDContractorAddress Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDContractorContactPerson #Region "Private fields" Private _position As String Private _name As String Private _phoneNumber As String Private _facsimileNumber As String Private _mailAddress As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property Position() As String Get Return Me._position End Get Set(value As String) Me._position = Value End Set End Property _ Public Property Name() As String Get Return Me._name End Get Set(value As String) Me._name = Value End Set End Property _ Public Property PhoneNumber() As String Get Return Me._phoneNumber End Get Set(value As String) Me._phoneNumber = Value End Set End Property _ Public Property FacsimileNumber() As String Get Return Me._facsimileNumber End Get Set(value As String) Me._facsimileNumber = Value End Set End Property _ Public Property MailAddress() As String Get Return Me._mailAddress End Get Set(value As String) Me._mailAddress = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDContractorContactPerson)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDContractorContactPerson object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDContractorContactPerson object ''' ''' string workflow markup to deserialize ''' Output DEXPDDContractorContactPerson 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 DEXPDDContractorContactPerson, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDContractorContactPerson) 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 DEXPDDContractorContactPerson) 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 DEXPDDContractorContactPerson Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDContractorContactPerson) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDContractorContactPerson Return CType(Serializer.Deserialize(s), DEXPDDContractorContactPerson) End Function #End Region ''' ''' Serializes current DEXPDDContractorContactPerson object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDContractorContactPerson object ''' ''' string xml file to load and deserialize ''' Output DEXPDDContractorContactPerson 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 DEXPDDContractorContactPerson, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDContractorContactPerson) 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 DEXPDDContractorContactPerson) 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 DEXPDDContractorContactPerson Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDOutwardProcessingOwner #Region "Private fields" Private _class As DEXPDDOutwardProcessingOwnerClass Private _identification As DEXPDDOutwardProcessingOwnerIdentification Private _contactPerson As DEXPDDOutwardProcessingOwnerContactPerson Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._contactPerson = New DEXPDDOutwardProcessingOwnerContactPerson() Me._identification = New DEXPDDOutwardProcessingOwnerIdentification() End Sub Public Property [Class]() As DEXPDDOutwardProcessingOwnerClass Get Return Me._class End Get Set(value As DEXPDDOutwardProcessingOwnerClass) Me._class = Value End Set End Property Public Property Identification() As DEXPDDOutwardProcessingOwnerIdentification Get Return Me._identification End Get Set(value As DEXPDDOutwardProcessingOwnerIdentification) Me._identification = Value End Set End Property Public Property ContactPerson() As DEXPDDOutwardProcessingOwnerContactPerson Get Return Me._contactPerson End Get Set(value As DEXPDDOutwardProcessingOwnerContactPerson) Me._contactPerson = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDOutwardProcessingOwner)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDOutwardProcessingOwner object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDOutwardProcessingOwner object ''' ''' string workflow markup to deserialize ''' Output DEXPDDOutwardProcessingOwner 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 DEXPDDOutwardProcessingOwner, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDOutwardProcessingOwner) 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 DEXPDDOutwardProcessingOwner) 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 DEXPDDOutwardProcessingOwner Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDOutwardProcessingOwner) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDOutwardProcessingOwner Return CType(Serializer.Deserialize(s), DEXPDDOutwardProcessingOwner) End Function #End Region ''' ''' Serializes current DEXPDDOutwardProcessingOwner object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDOutwardProcessingOwner object ''' ''' string xml file to load and deserialize ''' Output DEXPDDOutwardProcessingOwner 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 DEXPDDOutwardProcessingOwner, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDOutwardProcessingOwner) 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 DEXPDDOutwardProcessingOwner) 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 DEXPDDOutwardProcessingOwner Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDOutwardProcessingOwnerClass ''' _ Item2 End Enum _ Partial Public Class DEXPDDOutwardProcessingOwnerIdentification #Region "Private fields" Private _referenceNumber As String Private _subsidiaryNumber As DEXPDDOutwardProcessingOwnerIdentificationSubsidiaryNumber Private Shared sSerializer As XmlSerializer #End Region _ Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set(value As String) Me._referenceNumber = Value End Set End Property Public Property SubsidiaryNumber() As DEXPDDOutwardProcessingOwnerIdentificationSubsidiaryNumber Get Return Me._subsidiaryNumber End Get Set(value As DEXPDDOutwardProcessingOwnerIdentificationSubsidiaryNumber) Me._subsidiaryNumber = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDOutwardProcessingOwnerIdentification)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDOutwardProcessingOwnerIdentification object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDOutwardProcessingOwnerIdentification object ''' ''' string workflow markup to deserialize ''' Output DEXPDDOutwardProcessingOwnerIdentification 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 DEXPDDOutwardProcessingOwnerIdentification, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDOutwardProcessingOwnerIdentification) 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 DEXPDDOutwardProcessingOwnerIdentification) 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 DEXPDDOutwardProcessingOwnerIdentification Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDOutwardProcessingOwnerIdentification) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDOutwardProcessingOwnerIdentification Return CType(Serializer.Deserialize(s), DEXPDDOutwardProcessingOwnerIdentification) End Function #End Region ''' ''' Serializes current DEXPDDOutwardProcessingOwnerIdentification object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDOutwardProcessingOwnerIdentification object ''' ''' string xml file to load and deserialize ''' Output DEXPDDOutwardProcessingOwnerIdentification 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 DEXPDDOutwardProcessingOwnerIdentification, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDOutwardProcessingOwnerIdentification) 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 DEXPDDOutwardProcessingOwnerIdentification) 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 DEXPDDOutwardProcessingOwnerIdentification Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDOutwardProcessingOwnerIdentificationSubsidiaryNumber ''' _ Item0000 End Enum _ Partial Public Class DEXPDDOutwardProcessingOwnerContactPerson #Region "Private fields" Private _position As String Private _name As String Private _phoneNumber As String Private _facsimileNumber As String Private _mailAddress As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property Position() As String Get Return Me._position End Get Set(value As String) Me._position = Value End Set End Property _ Public Property Name() As String Get Return Me._name End Get Set(value As String) Me._name = Value End Set End Property _ Public Property PhoneNumber() As String Get Return Me._phoneNumber End Get Set(value As String) Me._phoneNumber = Value End Set End Property _ Public Property FacsimileNumber() As String Get Return Me._facsimileNumber End Get Set(value As String) Me._facsimileNumber = Value End Set End Property _ Public Property MailAddress() As String Get Return Me._mailAddress End Get Set(value As String) Me._mailAddress = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDOutwardProcessingOwnerContactPerson)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDOutwardProcessingOwnerContactPerson object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDOutwardProcessingOwnerContactPerson object ''' ''' string workflow markup to deserialize ''' Output DEXPDDOutwardProcessingOwnerContactPerson 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 DEXPDDOutwardProcessingOwnerContactPerson, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDOutwardProcessingOwnerContactPerson) 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 DEXPDDOutwardProcessingOwnerContactPerson) 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 DEXPDDOutwardProcessingOwnerContactPerson Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDOutwardProcessingOwnerContactPerson) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDOutwardProcessingOwnerContactPerson Return CType(Serializer.Deserialize(s), DEXPDDOutwardProcessingOwnerContactPerson) End Function #End Region ''' ''' Serializes current DEXPDDOutwardProcessingOwnerContactPerson object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDOutwardProcessingOwnerContactPerson object ''' ''' string xml file to load and deserialize ''' Output DEXPDDOutwardProcessingOwnerContactPerson 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 DEXPDDOutwardProcessingOwnerContactPerson, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDOutwardProcessingOwnerContactPerson) 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 DEXPDDOutwardProcessingOwnerContactPerson) 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 DEXPDDOutwardProcessingOwnerContactPerson Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDConsignee #Region "Private fields" Private _class As DEXPDDConsigneeClass Private _identification As DEXPDDConsigneeIdentification Private _name As String Private _address As DEXPDDConsigneeAddress Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._address = New DEXPDDConsigneeAddress() Me._identification = New DEXPDDConsigneeIdentification() End Sub Public Property [Class]() As DEXPDDConsigneeClass Get Return Me._class End Get Set(value As DEXPDDConsigneeClass) Me._class = Value End Set End Property Public Property Identification() As DEXPDDConsigneeIdentification Get Return Me._identification End Get Set(value As DEXPDDConsigneeIdentification) Me._identification = Value End Set End Property _ Public Property Name() As String Get Return Me._name End Get Set(value As String) Me._name = Value End Set End Property Public Property Address() As DEXPDDConsigneeAddress Get Return Me._address End Get Set(value As DEXPDDConsigneeAddress) Me._address = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDConsignee)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDConsignee object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDConsignee object ''' ''' string workflow markup to deserialize ''' Output DEXPDDConsignee 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 DEXPDDConsignee, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDConsignee) 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 DEXPDDConsignee) 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 DEXPDDConsignee Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDConsignee) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDConsignee Return CType(Serializer.Deserialize(s), DEXPDDConsignee) End Function #End Region ''' ''' Serializes current DEXPDDConsignee object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDConsignee object ''' ''' string xml file to load and deserialize ''' Output DEXPDDConsignee 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 DEXPDDConsignee, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDConsignee) 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 DEXPDDConsignee) 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 DEXPDDConsignee Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDConsigneeClass ''' _ Item0 ''' _ Item2 ''' _ Item4 End Enum _ Partial Public Class DEXPDDConsigneeIdentification #Region "Private fields" Private _referenceNumber As String Private _subsidiaryNumber As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set(value As String) Me._referenceNumber = Value End Set End Property _ Public Property SubsidiaryNumber() As String Get Return Me._subsidiaryNumber End Get Set(value As String) Me._subsidiaryNumber = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDConsigneeIdentification)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDConsigneeIdentification object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDConsigneeIdentification object ''' ''' string workflow markup to deserialize ''' Output DEXPDDConsigneeIdentification 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 DEXPDDConsigneeIdentification, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDConsigneeIdentification) 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 DEXPDDConsigneeIdentification) 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 DEXPDDConsigneeIdentification Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDConsigneeIdentification) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDConsigneeIdentification Return CType(Serializer.Deserialize(s), DEXPDDConsigneeIdentification) End Function #End Region ''' ''' Serializes current DEXPDDConsigneeIdentification object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDConsigneeIdentification object ''' ''' string xml file to load and deserialize ''' Output DEXPDDConsigneeIdentification 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 DEXPDDConsigneeIdentification, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDConsigneeIdentification) 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 DEXPDDConsigneeIdentification) 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 DEXPDDConsigneeIdentification Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDConsigneeAddress #Region "Private fields" Private _line As String Private _city As String Private _postcode As String Private _country As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property Line() As String Get Return Me._line End Get Set(value As String) Me._line = Value End Set End Property _ Public Property City() As String Get Return Me._city End Get Set(value As String) Me._city = Value End Set End Property _ Public Property Postcode() As String Get Return Me._postcode End Get Set(value As String) Me._postcode = Value End Set End Property _ Public Property Country() As String Get Return Me._country End Get Set(value As String) Me._country = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDConsigneeAddress)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDConsigneeAddress object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDConsigneeAddress object ''' ''' string workflow markup to deserialize ''' Output DEXPDDConsigneeAddress 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 DEXPDDConsigneeAddress, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDConsigneeAddress) 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 DEXPDDConsigneeAddress) 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 DEXPDDConsigneeAddress Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDConsigneeAddress) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDConsigneeAddress Return CType(Serializer.Deserialize(s), DEXPDDConsigneeAddress) End Function #End Region ''' ''' Serializes current DEXPDDConsigneeAddress object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDConsigneeAddress object ''' ''' string xml file to load and deserialize ''' Output DEXPDDConsigneeAddress 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 DEXPDDConsigneeAddress, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDConsigneeAddress) 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 DEXPDDConsigneeAddress) 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 DEXPDDConsigneeAddress Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDDeliveryTerms #Region "Private fields" Private _incotermCode As DEXPDDDeliveryTermsIncotermCode Private _description As String Private _location As String Private Shared sSerializer As XmlSerializer #End Region Public Property IncotermCode() As DEXPDDDeliveryTermsIncotermCode Get Return Me._incotermCode End Get Set(value As DEXPDDDeliveryTermsIncotermCode) Me._incotermCode = Value End Set End Property _ Public Property Description() As String Get Return Me._description End Get Set(value As String) Me._description = Value End Set End Property _ Public Property Location() As String Get Return Me._location End Get Set(value As String) Me._location = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDDeliveryTerms)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDDeliveryTerms object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDDeliveryTerms object ''' ''' string workflow markup to deserialize ''' Output DEXPDDDeliveryTerms 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 DEXPDDDeliveryTerms, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDDeliveryTerms) 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 DEXPDDDeliveryTerms) 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 DEXPDDDeliveryTerms Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDDeliveryTerms) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDDeliveryTerms Return CType(Serializer.Deserialize(s), DEXPDDDeliveryTerms) End Function #End Region ''' ''' Serializes current DEXPDDDeliveryTerms object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDDeliveryTerms object ''' ''' string xml file to load and deserialize ''' Output DEXPDDDeliveryTerms 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 DEXPDDDeliveryTerms, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDDeliveryTerms) 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 DEXPDDDeliveryTerms) 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 DEXPDDDeliveryTerms Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDDeliveryTermsIncotermCode ''' CFR ''' CIF ''' CIP ''' CPT ''' DAF ''' DAP ''' DAT ''' DDP ''' DDU ''' DEQ ''' DES ''' EXW ''' FAS ''' FCA ''' FOB ''' XXX End Enum _ Partial Public Class DEXPDDOutwardProcessing #Region "Private fields" Private _reimportDate As Date Private _usualReplacement As DEXPDDOutwardProcessingUsualReplacement Private _reimport As List(Of DEXPDDOutwardProcessingReimport) Private _identificationMeans As List(Of DEXPDDOutwardProcessingIdentificationMeans) Private _product As List(Of DEXPDDOutwardProcessingProduct) Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._product = New List(Of DEXPDDOutwardProcessingProduct)() Me._identificationMeans = New List(Of DEXPDDOutwardProcessingIdentificationMeans)() Me._reimport = New List(Of DEXPDDOutwardProcessingReimport)() End Sub _ Public Property ReimportDate() As Date Get Return Me._reimportDate End Get Set(value As Date) Me._reimportDate = Value End Set End Property Public Property UsualReplacement() As DEXPDDOutwardProcessingUsualReplacement Get Return Me._usualReplacement End Get Set(value As DEXPDDOutwardProcessingUsualReplacement) Me._usualReplacement = Value End Set End Property _ Public Property Reimport() As List(Of DEXPDDOutwardProcessingReimport) Get Return Me._reimport End Get Set(value As List(Of DEXPDDOutwardProcessingReimport)) Me._reimport = Value End Set End Property _ Public Property IdentificationMeans() As List(Of DEXPDDOutwardProcessingIdentificationMeans) Get Return Me._identificationMeans End Get Set(value As List(Of DEXPDDOutwardProcessingIdentificationMeans)) Me._identificationMeans = Value End Set End Property _ Public Property Product() As List(Of DEXPDDOutwardProcessingProduct) Get Return Me._product End Get Set(value As List(Of DEXPDDOutwardProcessingProduct)) Me._product = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDOutwardProcessing)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDOutwardProcessing object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDOutwardProcessing object ''' ''' string workflow markup to deserialize ''' Output DEXPDDOutwardProcessing 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 DEXPDDOutwardProcessing, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDOutwardProcessing) 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 DEXPDDOutwardProcessing) 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 DEXPDDOutwardProcessing Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDOutwardProcessing) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDOutwardProcessing Return CType(Serializer.Deserialize(s), DEXPDDOutwardProcessing) End Function #End Region ''' ''' Serializes current DEXPDDOutwardProcessing object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDOutwardProcessing object ''' ''' string xml file to load and deserialize ''' Output DEXPDDOutwardProcessing 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 DEXPDDOutwardProcessing, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDOutwardProcessing) 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 DEXPDDOutwardProcessing) 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 DEXPDDOutwardProcessing Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDOutwardProcessingUsualReplacement ''' _ Item0 ''' _ Item1 End Enum _ Partial Public Class DEXPDDOutwardProcessingReimport #Region "Private fields" Private _country As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property Country() As String Get Return Me._country End Get Set(value As String) Me._country = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDOutwardProcessingReimport)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDOutwardProcessingReimport object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDOutwardProcessingReimport object ''' ''' string workflow markup to deserialize ''' Output DEXPDDOutwardProcessingReimport 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 DEXPDDOutwardProcessingReimport, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDOutwardProcessingReimport) 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 DEXPDDOutwardProcessingReimport) 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 DEXPDDOutwardProcessingReimport Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDOutwardProcessingReimport) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDOutwardProcessingReimport Return CType(Serializer.Deserialize(s), DEXPDDOutwardProcessingReimport) End Function #End Region ''' ''' Serializes current DEXPDDOutwardProcessingReimport object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDOutwardProcessingReimport object ''' ''' string xml file to load and deserialize ''' Output DEXPDDOutwardProcessingReimport 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 DEXPDDOutwardProcessingReimport, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDOutwardProcessingReimport) 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 DEXPDDOutwardProcessingReimport) 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 DEXPDDOutwardProcessingReimport Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDOutwardProcessingIdentificationMeans #Region "Private fields" Private _type As DEXPDDOutwardProcessingIdentificationMeansType Private _description As String Private Shared sSerializer As XmlSerializer #End Region Public Property Type() As DEXPDDOutwardProcessingIdentificationMeansType Get Return Me._type End Get Set(value As DEXPDDOutwardProcessingIdentificationMeansType) Me._type = Value End Set End Property _ Public Property Description() As String Get Return Me._description End Get Set(value As String) Me._description = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDOutwardProcessingIdentificationMeans)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDOutwardProcessingIdentificationMeans object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDOutwardProcessingIdentificationMeans object ''' ''' string workflow markup to deserialize ''' Output DEXPDDOutwardProcessingIdentificationMeans 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 DEXPDDOutwardProcessingIdentificationMeans, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDOutwardProcessingIdentificationMeans) 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 DEXPDDOutwardProcessingIdentificationMeans) 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 DEXPDDOutwardProcessingIdentificationMeans Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDOutwardProcessingIdentificationMeans) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDOutwardProcessingIdentificationMeans Return CType(Serializer.Deserialize(s), DEXPDDOutwardProcessingIdentificationMeans) End Function #End Region ''' ''' Serializes current DEXPDDOutwardProcessingIdentificationMeans object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDOutwardProcessingIdentificationMeans object ''' ''' string xml file to load and deserialize ''' Output DEXPDDOutwardProcessingIdentificationMeans 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 DEXPDDOutwardProcessingIdentificationMeans, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDOutwardProcessingIdentificationMeans) 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 DEXPDDOutwardProcessingIdentificationMeans) 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 DEXPDDOutwardProcessingIdentificationMeans Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDOutwardProcessingIdentificationMeansType ''' A ''' B ''' N ''' O ''' P ''' S ''' T ''' Z End Enum _ Partial Public Class DEXPDDOutwardProcessingProduct #Region "Private fields" Private _commodityCode As String Private _goodsDescription As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property CommodityCode() As String Get Return Me._commodityCode End Get Set(value As String) Me._commodityCode = Value End Set End Property _ Public Property GoodsDescription() As String Get Return Me._goodsDescription End Get Set(value As String) Me._goodsDescription = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDOutwardProcessingProduct)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDOutwardProcessingProduct object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDOutwardProcessingProduct object ''' ''' string workflow markup to deserialize ''' Output DEXPDDOutwardProcessingProduct 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 DEXPDDOutwardProcessingProduct, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDOutwardProcessingProduct) 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 DEXPDDOutwardProcessingProduct) 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 DEXPDDOutwardProcessingProduct Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDOutwardProcessingProduct) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDOutwardProcessingProduct Return CType(Serializer.Deserialize(s), DEXPDDOutwardProcessingProduct) End Function #End Region ''' ''' Serializes current DEXPDDOutwardProcessingProduct object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDOutwardProcessingProduct object ''' ''' string xml file to load and deserialize ''' Output DEXPDDOutwardProcessingProduct 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 DEXPDDOutwardProcessingProduct, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDOutwardProcessingProduct) 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 DEXPDDOutwardProcessingProduct) 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 DEXPDDOutwardProcessingProduct Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDGoodsItem #Region "Private fields" Private _sequenceNumber As String Private _goodsDescription As String Private _commercialReferenceNumber As String Private _registrationNumber As String Private _annotation As String Private _originFederalState As DEXPDDGoodsItemOriginFederalState Private _netMass As Decimal Private _grossMass As Decimal Private _dangerousGoodsCode As String Private _transportChargesPaymentMethod As String Private _commodityCode As DEXPDDGoodsItemCommodityCode Private _procedure As DEXPDDGoodsItemProcedure Private _exportRefund As DEXPDDGoodsItemExportRefund Private _foreignTradeStatistics As DEXPDDGoodsItemForeignTradeStatistics Private _consignee As DEXPDDGoodsItemConsignee Private _package As List(Of DEXPDDGoodsItemPackage) Private _container As List(Of DEXPDDGoodsItemContainer) Private _document As List(Of DEXPDDGoodsItemDocument) Private _previousAdminstrativeReference As List(Of DEXPDDGoodsItemPreviousAdminstrativeReference) Private _deliveryTerms As DEXPDDGoodsItemDeliveryTerms Private _transaction As DEXPDDGoodsItemTransaction Private _customsWarehouse As DEXPDDGoodsItemCustomsWarehouse Private _inwardProcessingTransformation As DEXPDDGoodsItemInwardProcessingTransformation Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._inwardProcessingTransformation = New DEXPDDGoodsItemInwardProcessingTransformation() Me._customsWarehouse = New DEXPDDGoodsItemCustomsWarehouse() Me._transaction = New DEXPDDGoodsItemTransaction() Me._deliveryTerms = New DEXPDDGoodsItemDeliveryTerms() Me._previousAdminstrativeReference = New List(Of DEXPDDGoodsItemPreviousAdminstrativeReference)() Me._document = New List(Of DEXPDDGoodsItemDocument)() Me._container = New List(Of DEXPDDGoodsItemContainer)() Me._package = New List(Of DEXPDDGoodsItemPackage)() Me._consignee = New DEXPDDGoodsItemConsignee() Me._foreignTradeStatistics = New DEXPDDGoodsItemForeignTradeStatistics() Me._exportRefund = New DEXPDDGoodsItemExportRefund() Me._procedure = New DEXPDDGoodsItemProcedure() Me._commodityCode = New DEXPDDGoodsItemCommodityCode() End Sub _ Public Property SequenceNumber() As String Get Return Me._sequenceNumber End Get Set(value As String) Me._sequenceNumber = Value End Set End Property _ Public Property GoodsDescription() As String Get Return Me._goodsDescription End Get Set(value As String) Me._goodsDescription = Value End Set End Property _ Public Property CommercialReferenceNumber() As String Get Return Me._commercialReferenceNumber End Get Set(value As String) Me._commercialReferenceNumber = Value End Set End Property _ Public Property RegistrationNumber() As String Get Return Me._registrationNumber End Get Set(value As String) Me._registrationNumber = Value End Set End Property _ Public Property Annotation() As String Get Return Me._annotation End Get Set(value As String) Me._annotation = Value End Set End Property Public Property OriginFederalState() As DEXPDDGoodsItemOriginFederalState Get Return Me._originFederalState End Get Set(value As DEXPDDGoodsItemOriginFederalState) Me._originFederalState = Value End Set End Property Public Property NetMass() As Decimal Get Return Me._netMass End Get Set(value As Decimal) Me._netMass = Value End Set End Property Public Property GrossMass() As Decimal Get Return Me._grossMass End Get Set(value As Decimal) Me._grossMass = Value End Set End Property _ Public Property DangerousGoodsCode() As String Get Return Me._dangerousGoodsCode End Get Set(value As String) Me._dangerousGoodsCode = Value End Set End Property _ Public Property TransportChargesPaymentMethod() As String Get Return Me._transportChargesPaymentMethod End Get Set(value As String) Me._transportChargesPaymentMethod = Value End Set End Property Public Property CommodityCode() As DEXPDDGoodsItemCommodityCode Get Return Me._commodityCode End Get Set(value As DEXPDDGoodsItemCommodityCode) Me._commodityCode = Value End Set End Property Public Property Procedure() As DEXPDDGoodsItemProcedure Get Return Me._procedure End Get Set(value As DEXPDDGoodsItemProcedure) Me._procedure = Value End Set End Property Public Property ExportRefund() As DEXPDDGoodsItemExportRefund Get Return Me._exportRefund End Get Set(value As DEXPDDGoodsItemExportRefund) Me._exportRefund = Value End Set End Property Public Property ForeignTradeStatistics() As DEXPDDGoodsItemForeignTradeStatistics Get Return Me._foreignTradeStatistics End Get Set(value As DEXPDDGoodsItemForeignTradeStatistics) Me._foreignTradeStatistics = Value End Set End Property Public Property Consignee() As DEXPDDGoodsItemConsignee Get Return Me._consignee End Get Set(value As DEXPDDGoodsItemConsignee) Me._consignee = Value End Set End Property _ Public Property Package() As List(Of DEXPDDGoodsItemPackage) Get Return Me._package End Get Set(value As List(Of DEXPDDGoodsItemPackage)) Me._package = Value End Set End Property _ Public Property Container() As List(Of DEXPDDGoodsItemContainer) Get Return Me._container End Get Set(value As List(Of DEXPDDGoodsItemContainer)) Me._container = Value End Set End Property _ Public Property Document() As List(Of DEXPDDGoodsItemDocument) Get Return Me._document End Get Set(value As List(Of DEXPDDGoodsItemDocument)) Me._document = Value End Set End Property _ Public Property PreviousAdminstrativeReference() As List(Of DEXPDDGoodsItemPreviousAdminstrativeReference) Get Return Me._previousAdminstrativeReference End Get Set(value As List(Of DEXPDDGoodsItemPreviousAdminstrativeReference)) Me._previousAdminstrativeReference = Value End Set End Property Public Property DeliveryTerms() As DEXPDDGoodsItemDeliveryTerms Get Return Me._deliveryTerms End Get Set(value As DEXPDDGoodsItemDeliveryTerms) Me._deliveryTerms = Value End Set End Property Public Property Transaction() As DEXPDDGoodsItemTransaction Get Return Me._transaction End Get Set(value As DEXPDDGoodsItemTransaction) Me._transaction = Value End Set End Property Public Property CustomsWarehouse() As DEXPDDGoodsItemCustomsWarehouse Get Return Me._customsWarehouse End Get Set(value As DEXPDDGoodsItemCustomsWarehouse) Me._customsWarehouse = Value End Set End Property _ Public Property InwardProcessingTransformation() As DEXPDDGoodsItemInwardProcessingTransformation Get Return Me._inwardProcessingTransformation End Get Set(value As DEXPDDGoodsItemInwardProcessingTransformation) Me._inwardProcessingTransformation = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItem)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItem object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItem object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItem 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 DEXPDDGoodsItem, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItem) 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 DEXPDDGoodsItem) 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 DEXPDDGoodsItem Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItem) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItem Return CType(Serializer.Deserialize(s), DEXPDDGoodsItem) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItem object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItem object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItem 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 DEXPDDGoodsItem, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItem) 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 DEXPDDGoodsItem) 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 DEXPDDGoodsItem Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDGoodsItemOriginFederalState ''' _ Item01 ''' _ Item02 ''' _ Item03 ''' _ Item04 ''' _ Item05 ''' _ Item06 ''' _ Item07 ''' _ Item08 ''' _ Item09 ''' _ Item10 ''' _ Item11 ''' _ Item12 ''' _ Item13 ''' _ Item14 ''' _ Item15 ''' _ Item16 ''' _ Item99 End Enum _ Partial Public Class DEXPDDGoodsItemCommodityCode #Region "Private fields" Private _combinedNomenclatureCode As String Private _taricCode As String Private _taricFirstAdditionalCode As String Private _taricSecondAdditionalCode As String Private _nationalAdditionalCode As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property CombinedNomenclatureCode() As String Get Return Me._combinedNomenclatureCode End Get Set(value As String) Me._combinedNomenclatureCode = Value End Set End Property _ Public Property TaricCode() As String Get Return Me._taricCode End Get Set(value As String) Me._taricCode = Value End Set End Property _ Public Property TaricFirstAdditionalCode() As String Get Return Me._taricFirstAdditionalCode End Get Set(value As String) Me._taricFirstAdditionalCode = Value End Set End Property _ Public Property TaricSecondAdditionalCode() As String Get Return Me._taricSecondAdditionalCode End Get Set(value As String) Me._taricSecondAdditionalCode = Value End Set End Property _ Public Property NationalAdditionalCode() As String Get Return Me._nationalAdditionalCode End Get Set(value As String) Me._nationalAdditionalCode = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemCommodityCode)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemCommodityCode object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemCommodityCode object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemCommodityCode 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 DEXPDDGoodsItemCommodityCode, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemCommodityCode) 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 DEXPDDGoodsItemCommodityCode) 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 DEXPDDGoodsItemCommodityCode Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemCommodityCode) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemCommodityCode Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemCommodityCode) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemCommodityCode object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemCommodityCode object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemCommodityCode 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 DEXPDDGoodsItemCommodityCode, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemCommodityCode) 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 DEXPDDGoodsItemCommodityCode) 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 DEXPDDGoodsItemCommodityCode Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDGoodsItemProcedure #Region "Private fields" Private _requestedProcedure As String Private _previousProcedure As String Private _additionalProcedure As String Private _exportRefundProcedure As DEXPDDGoodsItemProcedureExportRefundProcedure Private Shared sSerializer As XmlSerializer #End Region _ Public Property RequestedProcedure() As String Get Return Me._requestedProcedure End Get Set(value As String) Me._requestedProcedure = Value End Set End Property _ Public Property PreviousProcedure() As String Get Return Me._previousProcedure End Get Set(value As String) Me._previousProcedure = Value End Set End Property _ Public Property AdditionalProcedure() As String Get Return Me._additionalProcedure End Get Set(value As String) Me._additionalProcedure = Value End Set End Property Public Property ExportRefundProcedure() As DEXPDDGoodsItemProcedureExportRefundProcedure Get Return Me._exportRefundProcedure End Get Set(value As DEXPDDGoodsItemProcedureExportRefundProcedure) Me._exportRefundProcedure = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemProcedure)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemProcedure object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemProcedure object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemProcedure 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 DEXPDDGoodsItemProcedure, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemProcedure) 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 DEXPDDGoodsItemProcedure) 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 DEXPDDGoodsItemProcedure Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemProcedure) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemProcedure Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemProcedure) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemProcedure object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemProcedure object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemProcedure 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 DEXPDDGoodsItemProcedure, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemProcedure) 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 DEXPDDGoodsItemProcedure) 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 DEXPDDGoodsItemProcedure Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDGoodsItemProcedureExportRefundProcedure ''' E51 ''' E52 ''' E53 ''' E61 ''' E62 ''' E63 ''' E71 End Enum _ Partial Public Class DEXPDDGoodsItemExportRefund #Region "Private fields" Private _quantity As Decimal Private Shared sSerializer As XmlSerializer #End Region Public Property Quantity() As Decimal Get Return Me._quantity End Get Set(value As Decimal) Me._quantity = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemExportRefund)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemExportRefund object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemExportRefund object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemExportRefund 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 DEXPDDGoodsItemExportRefund, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemExportRefund) 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 DEXPDDGoodsItemExportRefund) 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 DEXPDDGoodsItemExportRefund Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemExportRefund) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemExportRefund Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemExportRefund) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemExportRefund object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemExportRefund object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemExportRefund 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 DEXPDDGoodsItemExportRefund, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemExportRefund) 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 DEXPDDGoodsItemExportRefund) 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 DEXPDDGoodsItemExportRefund Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDGoodsItemForeignTradeStatistics #Region "Private fields" Private _specialUnitQuantity As Decimal Private _statisticalValue As String Private Shared sSerializer As XmlSerializer #End Region Public Property SpecialUnitQuantity() As Decimal Get Return Me._specialUnitQuantity End Get Set(value As Decimal) Me._specialUnitQuantity = Value End Set End Property _ Public Property StatisticalValue() As String Get Return Me._statisticalValue End Get Set(value As String) Me._statisticalValue = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemForeignTradeStatistics)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemForeignTradeStatistics object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemForeignTradeStatistics object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemForeignTradeStatistics 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 DEXPDDGoodsItemForeignTradeStatistics, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemForeignTradeStatistics) 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 DEXPDDGoodsItemForeignTradeStatistics) 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 DEXPDDGoodsItemForeignTradeStatistics Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemForeignTradeStatistics) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemForeignTradeStatistics Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemForeignTradeStatistics) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemForeignTradeStatistics object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemForeignTradeStatistics object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemForeignTradeStatistics 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 DEXPDDGoodsItemForeignTradeStatistics, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemForeignTradeStatistics) 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 DEXPDDGoodsItemForeignTradeStatistics) 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 DEXPDDGoodsItemForeignTradeStatistics Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDGoodsItemConsignee #Region "Private fields" Private _class As DEXPDDGoodsItemConsigneeClass Private _identification As DEXPDDGoodsItemConsigneeIdentification Private _name As String Private _address As DEXPDDGoodsItemConsigneeAddress Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._address = New DEXPDDGoodsItemConsigneeAddress() Me._identification = New DEXPDDGoodsItemConsigneeIdentification() End Sub Public Property [Class]() As DEXPDDGoodsItemConsigneeClass Get Return Me._class End Get Set(value As DEXPDDGoodsItemConsigneeClass) Me._class = Value End Set End Property Public Property Identification() As DEXPDDGoodsItemConsigneeIdentification Get Return Me._identification End Get Set(value As DEXPDDGoodsItemConsigneeIdentification) Me._identification = Value End Set End Property _ Public Property Name() As String Get Return Me._name End Get Set(value As String) Me._name = Value End Set End Property Public Property Address() As DEXPDDGoodsItemConsigneeAddress Get Return Me._address End Get Set(value As DEXPDDGoodsItemConsigneeAddress) Me._address = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemConsignee)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemConsignee object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemConsignee object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemConsignee 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 DEXPDDGoodsItemConsignee, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemConsignee) 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 DEXPDDGoodsItemConsignee) 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 DEXPDDGoodsItemConsignee Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemConsignee) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemConsignee Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemConsignee) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemConsignee object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemConsignee object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemConsignee 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 DEXPDDGoodsItemConsignee, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemConsignee) 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 DEXPDDGoodsItemConsignee) 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 DEXPDDGoodsItemConsignee Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDGoodsItemConsigneeClass ''' _ Item0 ''' _ Item2 ''' _ Item4 End Enum _ Partial Public Class DEXPDDGoodsItemConsigneeIdentification #Region "Private fields" Private _referenceNumber As String Private _subsidiaryNumber As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set(value As String) Me._referenceNumber = Value End Set End Property _ Public Property SubsidiaryNumber() As String Get Return Me._subsidiaryNumber End Get Set(value As String) Me._subsidiaryNumber = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemConsigneeIdentification)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemConsigneeIdentification object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemConsigneeIdentification object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemConsigneeIdentification 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 DEXPDDGoodsItemConsigneeIdentification, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemConsigneeIdentification) 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 DEXPDDGoodsItemConsigneeIdentification) 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 DEXPDDGoodsItemConsigneeIdentification Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemConsigneeIdentification) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemConsigneeIdentification Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemConsigneeIdentification) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemConsigneeIdentification object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemConsigneeIdentification object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemConsigneeIdentification 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 DEXPDDGoodsItemConsigneeIdentification, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemConsigneeIdentification) 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 DEXPDDGoodsItemConsigneeIdentification) 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 DEXPDDGoodsItemConsigneeIdentification Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDGoodsItemConsigneeAddress #Region "Private fields" Private _line As String Private _city As String Private _postcode As String Private _country As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property Line() As String Get Return Me._line End Get Set(value As String) Me._line = Value End Set End Property _ Public Property City() As String Get Return Me._city End Get Set(value As String) Me._city = Value End Set End Property _ Public Property Postcode() As String Get Return Me._postcode End Get Set(value As String) Me._postcode = Value End Set End Property _ Public Property Country() As String Get Return Me._country End Get Set(value As String) Me._country = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemConsigneeAddress)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemConsigneeAddress object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemConsigneeAddress object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemConsigneeAddress 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 DEXPDDGoodsItemConsigneeAddress, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemConsigneeAddress) 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 DEXPDDGoodsItemConsigneeAddress) 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 DEXPDDGoodsItemConsigneeAddress Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemConsigneeAddress) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemConsigneeAddress Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemConsigneeAddress) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemConsigneeAddress object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemConsigneeAddress object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemConsigneeAddress 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 DEXPDDGoodsItemConsigneeAddress, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemConsigneeAddress) 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 DEXPDDGoodsItemConsigneeAddress) 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 DEXPDDGoodsItemConsigneeAddress Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDGoodsItemPackage #Region "Private fields" Private _quantity As String Private _sequenceNumber As String Private _kind As String Private _marksNumbers As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property Quantity() As String Get Return Me._quantity End Get Set(value As String) Me._quantity = Value End Set End Property _ Public Property SequenceNumber() As String Get Return Me._sequenceNumber End Get Set(value As String) Me._sequenceNumber = Value End Set End Property _ Public Property Kind() As String Get Return Me._kind End Get Set(value As String) Me._kind = Value End Set End Property _ Public Property MarksNumbers() As String Get Return Me._marksNumbers End Get Set(value As String) Me._marksNumbers = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemPackage)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemPackage object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemPackage object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemPackage 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 DEXPDDGoodsItemPackage, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemPackage) 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 DEXPDDGoodsItemPackage) 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 DEXPDDGoodsItemPackage Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemPackage) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemPackage Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemPackage) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemPackage object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemPackage object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemPackage 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 DEXPDDGoodsItemPackage, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemPackage) 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 DEXPDDGoodsItemPackage) 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 DEXPDDGoodsItemPackage Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDGoodsItemContainer #Region "Private fields" Private _identificationNumber As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property IdentificationNumber() As String Get Return Me._identificationNumber End Get Set(value As String) Me._identificationNumber = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemContainer)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemContainer object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemContainer object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemContainer 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 DEXPDDGoodsItemContainer, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemContainer) 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 DEXPDDGoodsItemContainer) 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 DEXPDDGoodsItemContainer Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemContainer) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemContainer Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemContainer) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemContainer object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemContainer object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemContainer 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 DEXPDDGoodsItemContainer, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemContainer) 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 DEXPDDGoodsItemContainer) 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 DEXPDDGoodsItemContainer Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDGoodsItemDocument #Region "Private fields" Private _qualifier As String Private _type As String Private _referenceNumber As String Private _complement As String Private _detail As String Private _issuingDate As Date Private _expiryDate As Date Private _writeOffValue As String Private _measurementUnit As DEXPDDGoodsItemDocumentMeasurementUnit Private _writeOffQuantity As Decimal Private Shared sSerializer As XmlSerializer #End Region _ Public Property Qualifier() As String Get Return Me._qualifier End Get Set(value As String) Me._qualifier = Value End Set End Property _ Public Property Type() As String Get Return Me._type End Get Set(value As String) Me._type = Value End Set End Property _ Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set(value As String) Me._referenceNumber = Value End Set End Property _ Public Property Complement() As String Get Return Me._complement End Get Set(value As String) Me._complement = Value End Set End Property _ Public Property Detail() As String Get Return Me._detail End Get Set(value As String) Me._detail = Value End Set End Property _ Public Property IssuingDate() As Date Get Return Me._issuingDate End Get Set(value As Date) Me._issuingDate = Value End Set End Property _ Public Property ExpiryDate() As Date Get Return Me._expiryDate End Get Set(value As Date) Me._expiryDate = Value End Set End Property _ Public Property WriteOffValue() As String Get Return Me._writeOffValue End Get Set(value As String) Me._writeOffValue = Value End Set End Property Public Property MeasurementUnit() As DEXPDDGoodsItemDocumentMeasurementUnit Get Return Me._measurementUnit End Get Set(value As DEXPDDGoodsItemDocumentMeasurementUnit) Me._measurementUnit = Value End Set End Property Public Property WriteOffQuantity() As Decimal Get Return Me._writeOffQuantity End Get Set(value As Decimal) Me._writeOffQuantity = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemDocument)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemDocument object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemDocument object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemDocument 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 DEXPDDGoodsItemDocument, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemDocument) 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 DEXPDDGoodsItemDocument) 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 DEXPDDGoodsItemDocument Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemDocument) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemDocument Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemDocument) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemDocument object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemDocument object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemDocument 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 DEXPDDGoodsItemDocument, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemDocument) 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 DEXPDDGoodsItemDocument) 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 DEXPDDGoodsItemDocument Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDGoodsItemDocumentMeasurementUnit ''' Los ''' Mio ''' Paar ''' Satz ''' St ''' Syst ''' cbm ''' cm ''' div ''' g ''' gPu ''' gTh ''' gU ''' kg ''' kgPu ''' kgTh ''' kgU ''' km ''' l ''' lfm ''' ltAnlage ''' m ''' mg ''' ml ''' mm ''' qcm ''' qm ''' t ''' tU ''' µg ''' µl ''' µm End Enum _ Partial Public Class DEXPDDGoodsItemPreviousAdminstrativeReference #Region "Private fields" Private _type As String Private _referenceNumber As String Private _complement As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property Type() As String Get Return Me._type End Get Set(value As String) Me._type = Value End Set End Property _ Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set(value As String) Me._referenceNumber = Value End Set End Property _ Public Property Complement() As String Get Return Me._complement End Get Set(value As String) Me._complement = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemPreviousAdminstrativeReference)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemPreviousAdminstrativeReference object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemPreviousAdminstrativeReference object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemPreviousAdminstrativeReference 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 DEXPDDGoodsItemPreviousAdminstrativeReference, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemPreviousAdminstrativeReference) 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 DEXPDDGoodsItemPreviousAdminstrativeReference) 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 DEXPDDGoodsItemPreviousAdminstrativeReference Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemPreviousAdminstrativeReference) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemPreviousAdminstrativeReference Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemPreviousAdminstrativeReference) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemPreviousAdminstrativeReference object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemPreviousAdminstrativeReference object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemPreviousAdminstrativeReference 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 DEXPDDGoodsItemPreviousAdminstrativeReference, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemPreviousAdminstrativeReference) 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 DEXPDDGoodsItemPreviousAdminstrativeReference) 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 DEXPDDGoodsItemPreviousAdminstrativeReference Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDGoodsItemDeliveryTerms #Region "Private fields" Private _incotermCode As DEXPDDGoodsItemDeliveryTermsIncotermCode Private _description As String Private _location As String Private Shared sSerializer As XmlSerializer #End Region Public Property IncotermCode() As DEXPDDGoodsItemDeliveryTermsIncotermCode Get Return Me._incotermCode End Get Set(value As DEXPDDGoodsItemDeliveryTermsIncotermCode) Me._incotermCode = Value End Set End Property _ Public Property Description() As String Get Return Me._description End Get Set(value As String) Me._description = Value End Set End Property _ Public Property Location() As String Get Return Me._location End Get Set(value As String) Me._location = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemDeliveryTerms)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemDeliveryTerms object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemDeliveryTerms object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemDeliveryTerms 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 DEXPDDGoodsItemDeliveryTerms, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemDeliveryTerms) 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 DEXPDDGoodsItemDeliveryTerms) 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 DEXPDDGoodsItemDeliveryTerms Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemDeliveryTerms) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemDeliveryTerms Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemDeliveryTerms) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemDeliveryTerms object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemDeliveryTerms object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemDeliveryTerms 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 DEXPDDGoodsItemDeliveryTerms, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemDeliveryTerms) 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 DEXPDDGoodsItemDeliveryTerms) 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 DEXPDDGoodsItemDeliveryTerms Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDGoodsItemDeliveryTermsIncotermCode ''' CFR ''' CIF ''' CIP ''' CPT ''' DAF ''' DAP ''' DAT ''' DDP ''' DDU ''' DEQ ''' DES ''' EXW ''' FAS ''' FCA ''' FOB ''' XXX End Enum _ Partial Public Class DEXPDDGoodsItemTransaction #Region "Private fields" Private _type As DEXPDDGoodsItemTransactionType Private Shared sSerializer As XmlSerializer #End Region Public Property Type() As DEXPDDGoodsItemTransactionType Get Return Me._type End Get Set(value As DEXPDDGoodsItemTransactionType) Me._type = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemTransaction)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemTransaction object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemTransaction object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemTransaction 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 DEXPDDGoodsItemTransaction, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemTransaction) 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 DEXPDDGoodsItemTransaction) 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 DEXPDDGoodsItemTransaction Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemTransaction) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemTransaction Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemTransaction) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemTransaction object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemTransaction object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemTransaction 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 DEXPDDGoodsItemTransaction, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemTransaction) 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 DEXPDDGoodsItemTransaction) 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 DEXPDDGoodsItemTransaction Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDGoodsItemTransactionType ''' _ Item11 ''' _ Item12 ''' _ Item13 ''' _ Item14 ''' _ Item19 ''' _ Item21 ''' _ Item22 ''' _ Item23 ''' _ Item29 ''' _ Item31 ''' _ Item32 ''' _ Item33 ''' _ Item34 ''' _ Item41 ''' _ Item42 ''' _ Item51 ''' _ Item52 ''' _ Item67 ''' _ Item69 ''' _ Item71 ''' _ Item72 ''' _ Item81 ''' _ Item91 ''' _ Item92 ''' _ Item99 End Enum _ Partial Public Class DEXPDDGoodsItemCustomsWarehouse #Region "Private fields" Private _goodsItemQuantity As String Private _customsAuthorization As DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization Private _localReferenceNumber As String Private _goodsItem As List(Of DEXPDDGoodsItemCustomsWarehouseGoodsItem) Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._goodsItem = New List(Of DEXPDDGoodsItemCustomsWarehouseGoodsItem)() Me._customsAuthorization = New DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization() End Sub _ Public Property GoodsItemQuantity() As String Get Return Me._goodsItemQuantity End Get Set(value As String) Me._goodsItemQuantity = Value End Set End Property Public Property CustomsAuthorization() As DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization Get Return Me._customsAuthorization End Get Set(value As DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization) Me._customsAuthorization = Value End Set End Property _ Public Property LocalReferenceNumber() As String Get Return Me._localReferenceNumber End Get Set(value As String) Me._localReferenceNumber = Value End Set End Property _ Public Property GoodsItem() As List(Of DEXPDDGoodsItemCustomsWarehouseGoodsItem) Get Return Me._goodsItem End Get Set(value As List(Of DEXPDDGoodsItemCustomsWarehouseGoodsItem)) Me._goodsItem = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemCustomsWarehouse)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemCustomsWarehouse object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemCustomsWarehouse object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemCustomsWarehouse 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 DEXPDDGoodsItemCustomsWarehouse, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemCustomsWarehouse) 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 DEXPDDGoodsItemCustomsWarehouse) 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 DEXPDDGoodsItemCustomsWarehouse Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemCustomsWarehouse) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemCustomsWarehouse Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemCustomsWarehouse) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemCustomsWarehouse object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemCustomsWarehouse object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemCustomsWarehouse 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 DEXPDDGoodsItemCustomsWarehouse, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemCustomsWarehouse) 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 DEXPDDGoodsItemCustomsWarehouse) 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 DEXPDDGoodsItemCustomsWarehouse Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization #Region "Private fields" Private _warehouseOwner As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property WarehouseOwner() As String Get Return Me._warehouseOwner End Get Set(value As String) Me._warehouseOwner = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization 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 DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization) 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 DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization) 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 DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization 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 DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization) 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 DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization) 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 DEXPDDGoodsItemCustomsWarehouseCustomsAuthorization Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDGoodsItemCustomsWarehouseGoodsItem #Region "Private fields" Private _sequenceNumber As String Private _referencedSequenceNumber As String Private _registrationNumber As String Private _commodityCode As String Private _accessViaAtlasFlag As DEXPDDGoodsItemCustomsWarehouseGoodsItemAccessViaAtlasFlag Private _usualProcessingFlag As DEXPDDGoodsItemCustomsWarehouseGoodsItemUsualProcessingFlag Private _complement As String Private _debitAmount As DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount Private _commercialAmount As DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._commercialAmount = New DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount() Me._debitAmount = New DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount() End Sub _ Public Property SequenceNumber() As String Get Return Me._sequenceNumber End Get Set(value As String) Me._sequenceNumber = Value End Set End Property _ Public Property ReferencedSequenceNumber() As String Get Return Me._referencedSequenceNumber End Get Set(value As String) Me._referencedSequenceNumber = Value End Set End Property _ Public Property RegistrationNumber() As String Get Return Me._registrationNumber End Get Set(value As String) Me._registrationNumber = Value End Set End Property _ Public Property CommodityCode() As String Get Return Me._commodityCode End Get Set(value As String) Me._commodityCode = Value End Set End Property Public Property AccessViaAtlasFlag() As DEXPDDGoodsItemCustomsWarehouseGoodsItemAccessViaAtlasFlag Get Return Me._accessViaAtlasFlag End Get Set(value As DEXPDDGoodsItemCustomsWarehouseGoodsItemAccessViaAtlasFlag) Me._accessViaAtlasFlag = Value End Set End Property Public Property UsualProcessingFlag() As DEXPDDGoodsItemCustomsWarehouseGoodsItemUsualProcessingFlag Get Return Me._usualProcessingFlag End Get Set(value As DEXPDDGoodsItemCustomsWarehouseGoodsItemUsualProcessingFlag) Me._usualProcessingFlag = Value End Set End Property _ Public Property Complement() As String Get Return Me._complement End Get Set(value As String) Me._complement = Value End Set End Property Public Property DebitAmount() As DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount Get Return Me._debitAmount End Get Set(value As DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount) Me._debitAmount = Value End Set End Property Public Property CommercialAmount() As DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount Get Return Me._commercialAmount End Get Set(value As DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount) Me._commercialAmount = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemCustomsWarehouseGoodsItem)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemCustomsWarehouseGoodsItem object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemCustomsWarehouseGoodsItem object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemCustomsWarehouseGoodsItem 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 DEXPDDGoodsItemCustomsWarehouseGoodsItem, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemCustomsWarehouseGoodsItem) 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 DEXPDDGoodsItemCustomsWarehouseGoodsItem) 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 DEXPDDGoodsItemCustomsWarehouseGoodsItem Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemCustomsWarehouseGoodsItem) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemCustomsWarehouseGoodsItem Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemCustomsWarehouseGoodsItem) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemCustomsWarehouseGoodsItem object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemCustomsWarehouseGoodsItem object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemCustomsWarehouseGoodsItem 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 DEXPDDGoodsItemCustomsWarehouseGoodsItem, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemCustomsWarehouseGoodsItem) 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 DEXPDDGoodsItemCustomsWarehouseGoodsItem) 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 DEXPDDGoodsItemCustomsWarehouseGoodsItem Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDGoodsItemCustomsWarehouseGoodsItemAccessViaAtlasFlag ''' _ Item0 ''' _ Item1 End Enum _ Public Enum DEXPDDGoodsItemCustomsWarehouseGoodsItemUsualProcessingFlag ''' _ Item0 ''' _ Item1 End Enum _ Partial Public Class DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount #Region "Private fields" Private _qualifier As String Private _measurementUnit As String Private _quantity As Decimal Private Shared sSerializer As XmlSerializer #End Region _ Public Property Qualifier() As String Get Return Me._qualifier End Get Set(value As String) Me._qualifier = Value End Set End Property _ Public Property MeasurementUnit() As String Get Return Me._measurementUnit End Get Set(value As String) Me._measurementUnit = Value End Set End Property Public Property Quantity() As Decimal Get Return Me._quantity End Get Set(value As Decimal) Me._quantity = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount 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 DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount) 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 DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount) 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 DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount 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 DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount) 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 DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount) 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 DEXPDDGoodsItemCustomsWarehouseGoodsItemDebitAmount Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount #Region "Private fields" Private _qualifier As String Private _measurementUnit As String Private _quantity As Decimal Private Shared sSerializer As XmlSerializer #End Region _ Public Property Qualifier() As String Get Return Me._qualifier End Get Set(value As String) Me._qualifier = Value End Set End Property _ Public Property MeasurementUnit() As String Get Return Me._measurementUnit End Get Set(value As String) Me._measurementUnit = Value End Set End Property Public Property Quantity() As Decimal Get Return Me._quantity End Get Set(value As Decimal) Me._quantity = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount 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 DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount) 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 DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount) 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 DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount 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 DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount) 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 DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount) 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 DEXPDDGoodsItemCustomsWarehouseGoodsItemCommercialAmount Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDGoodsItemInwardProcessingTransformation #Region "Private fields" Private _goodsItemQuantity As String Private _customsAuthorization As DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization Private _goodsItem As List(Of DEXPDDGoodsItemInwardProcessingTransformationGoodsItem) Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._goodsItem = New List(Of DEXPDDGoodsItemInwardProcessingTransformationGoodsItem)() Me._customsAuthorization = New DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization() End Sub _ Public Property GoodsItemQuantity() As String Get Return Me._goodsItemQuantity End Get Set(value As String) Me._goodsItemQuantity = Value End Set End Property Public Property CustomsAuthorization() As DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization Get Return Me._customsAuthorization End Get Set(value As DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization) Me._customsAuthorization = Value End Set End Property _ Public Property GoodsItem() As List(Of DEXPDDGoodsItemInwardProcessingTransformationGoodsItem) Get Return Me._goodsItem End Get Set(value As List(Of DEXPDDGoodsItemInwardProcessingTransformationGoodsItem)) Me._goodsItem = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemInwardProcessingTransformation)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemInwardProcessingTransformation object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemInwardProcessingTransformation object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemInwardProcessingTransformation 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 DEXPDDGoodsItemInwardProcessingTransformation, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemInwardProcessingTransformation) 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 DEXPDDGoodsItemInwardProcessingTransformation) 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 DEXPDDGoodsItemInwardProcessingTransformation Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemInwardProcessingTransformation) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemInwardProcessingTransformation Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemInwardProcessingTransformation) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemInwardProcessingTransformation object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemInwardProcessingTransformation object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemInwardProcessingTransformation 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 DEXPDDGoodsItemInwardProcessingTransformation, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemInwardProcessingTransformation) 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 DEXPDDGoodsItemInwardProcessingTransformation) 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 DEXPDDGoodsItemInwardProcessingTransformation Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization #Region "Private fields" Private _processingOwner As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property ProcessingOwner() As String Get Return Me._processingOwner End Get Set(value As String) Me._processingOwner = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization 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 DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization) 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 DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization) 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 DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization 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 DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization) 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 DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization) 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 DEXPDDGoodsItemInwardProcessingTransformationCustomsAuthorization Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class DEXPDDGoodsItemInwardProcessingTransformationGoodsItem #Region "Private fields" Private _sequenceNumber As String Private _referencedSequenceNumber As String Private _registrationNumber As String Private _accessViaAtlasFlag As DEXPDDGoodsItemInwardProcessingTransformationGoodsItemAccessViaAtlasFlag Private _goodsRelatedInformation As String Private Shared sSerializer As XmlSerializer #End Region _ Public Property SequenceNumber() As String Get Return Me._sequenceNumber End Get Set(value As String) Me._sequenceNumber = Value End Set End Property _ Public Property ReferencedSequenceNumber() As String Get Return Me._referencedSequenceNumber End Get Set(value As String) Me._referencedSequenceNumber = Value End Set End Property _ Public Property RegistrationNumber() As String Get Return Me._registrationNumber End Get Set(value As String) Me._registrationNumber = Value End Set End Property Public Property AccessViaAtlasFlag() As DEXPDDGoodsItemInwardProcessingTransformationGoodsItemAccessViaAtlasFlag Get Return Me._accessViaAtlasFlag End Get Set(value As DEXPDDGoodsItemInwardProcessingTransformationGoodsItemAccessViaAtlasFlag) Me._accessViaAtlasFlag = Value End Set End Property _ Public Property GoodsRelatedInformation() As String Get Return Me._goodsRelatedInformation End Get Set(value As String) Me._goodsRelatedInformation = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DEXPDDGoodsItemInwardProcessingTransformationGoodsItem)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current DEXPDDGoodsItemInwardProcessingTransformationGoodsItem object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an DEXPDDGoodsItemInwardProcessingTransformationGoodsItem object ''' ''' string workflow markup to deserialize ''' Output DEXPDDGoodsItemInwardProcessingTransformationGoodsItem 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 DEXPDDGoodsItemInwardProcessingTransformationGoodsItem, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemInwardProcessingTransformationGoodsItem) 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 DEXPDDGoodsItemInwardProcessingTransformationGoodsItem) 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 DEXPDDGoodsItemInwardProcessingTransformationGoodsItem Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DEXPDDGoodsItemInwardProcessingTransformationGoodsItem) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DEXPDDGoodsItemInwardProcessingTransformationGoodsItem Return CType(Serializer.Deserialize(s), DEXPDDGoodsItemInwardProcessingTransformationGoodsItem) End Function #End Region ''' ''' Serializes current DEXPDDGoodsItemInwardProcessingTransformationGoodsItem object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DEXPDDGoodsItemInwardProcessingTransformationGoodsItem object ''' ''' string xml file to load and deserialize ''' Output DEXPDDGoodsItemInwardProcessingTransformationGoodsItem 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 DEXPDDGoodsItemInwardProcessingTransformationGoodsItem, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DEXPDDGoodsItemInwardProcessingTransformationGoodsItem) 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 DEXPDDGoodsItemInwardProcessingTransformationGoodsItem) 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 DEXPDDGoodsItemInwardProcessingTransformationGoodsItem Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Public Enum DEXPDDGoodsItemInwardProcessingTransformationGoodsItemAccessViaAtlasFlag ''' _ Item0 ''' _ Item1 End Enum _ Partial Public Class [decimal] #Region "Private fields" Private _anyAttr As List(Of System.Xml.XmlAttribute) Private _value As Decimal Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._anyAttr = New List(Of System.Xml.XmlAttribute)() End Sub _ Public Property AnyAttr() As List(Of System.Xml.XmlAttribute) Get Return Me._anyAttr End Get Set(value As List(Of System.Xml.XmlAttribute)) Me._anyAttr = Value End Set End Property _ Public Property Value() As Decimal Get Return Me._value End Get Set(value As Decimal) Me._value = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType([decimal])) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current decimal object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an decimal object ''' ''' string workflow markup to deserialize ''' Output decimal 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 [decimal], ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, [decimal]) 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 [decimal]) 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 [decimal] Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), [decimal]) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As [decimal] Return CType(Serializer.Deserialize(s), [decimal]) End Function #End Region ''' ''' Serializes current decimal object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an decimal object ''' ''' string xml file to load and deserialize ''' Output decimal 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 [decimal], ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, [decimal]) 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 [decimal]) 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 [decimal] Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class [integer] #Region "Private fields" Private _anyAttr As List(Of System.Xml.XmlAttribute) Private _value As String Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._anyAttr = New List(Of System.Xml.XmlAttribute)() End Sub _ Public Property AnyAttr() As List(Of System.Xml.XmlAttribute) Get Return Me._anyAttr End Get Set(value As List(Of System.Xml.XmlAttribute)) Me._anyAttr = Value End Set End Property _ Public Property Value() As String Get Return Me._value End Get Set(value As String) Me._value = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType([integer])) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current integer object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an integer object ''' ''' string workflow markup to deserialize ''' Output integer 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 [integer], ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, [integer]) 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 [integer]) 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 [integer] Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), [integer]) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As [integer] Return CType(Serializer.Deserialize(s), [integer]) End Function #End Region ''' ''' Serializes current integer object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an integer object ''' ''' string xml file to load and deserialize ''' Output integer 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 [integer], ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, [integer]) 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 [integer]) 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 [integer] Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class _ Partial Public Class token #Region "Private fields" Private _anyAttr As List(Of System.Xml.XmlAttribute) Private _value As String Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New() Me._anyAttr = New List(Of System.Xml.XmlAttribute)() End Sub _ Public Property AnyAttr() As List(Of System.Xml.XmlAttribute) Get Return Me._anyAttr End Get Set(value As List(Of System.Xml.XmlAttribute)) Me._anyAttr = Value End Set End Property _ Public Property Value() As String Get Return Me._value End Get Set(value As String) Me._value = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(token)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current token object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = xmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an token object ''' ''' string workflow markup to deserialize ''' Output token 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 token, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, token) 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 token) 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 token Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), token) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As token Return CType(Serializer.Deserialize(s), token) End Function #End Region ''' ''' Serializes current token object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an token object ''' ''' string xml file to load and deserialize ''' Output token 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 token, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, token) 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 token) 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 token Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class End Namespace