'' ------------------------------------------------------------------------------ '' '' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com '' {"TargetFramework":"Net47","NameSpace":"UeberlassungsmeldungNCTSDE_009","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{},"JsonOutput":{},"Enabled":true,"DefaultEncoder":"ASCII"},"Miscellaneous":{}} '' '' ------------------------------------------------------------------------------ #Disable Warning Imports System Imports System.Diagnostics Imports System.Xml.Serialization Imports System.Runtime.Serialization Imports System.Collections Imports System.Xml.Schema Imports System.ComponentModel Imports System.Xml Imports System.IO Imports System.Text Imports System.Collections.Generic Namespace UeberlassungsmeldungNCTSDE_009 Partial Public Class UeberlassungsmeldungMRTyp Inherits DatenaustauschNCTSTyp #Region "Private fields" Private _einzelUeberlassungsmeldung As EinzelUeberlassungsmeldungTyp Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._einzelUeberlassungsmeldung = New EinzelUeberlassungsmeldungTyp() End Sub Public Property EinzelUeberlassungsmeldung() As EinzelUeberlassungsmeldungTyp Get Return Me._einzelUeberlassungsmeldung End Get Set Me._einzelUeberlassungsmeldung = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(UeberlassungsmeldungMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize UeberlassungsmeldungMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes UeberlassungsmeldungMRTyp object ''' ''' string to deserialize ''' Output UeberlassungsmeldungMRTyp 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 UeberlassungsmeldungMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, UeberlassungsmeldungMRTyp) 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 UeberlassungsmeldungMRTyp) 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 UeberlassungsmeldungMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), UeberlassungsmeldungMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As UeberlassungsmeldungMRTyp Return CType(SerializerXml.Deserialize(s), UeberlassungsmeldungMRTyp) End Function #End Region ''' ''' Serializes current UeberlassungsmeldungMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an UeberlassungsmeldungMRTyp object ''' ''' File to load and deserialize ''' Output UeberlassungsmeldungMRTyp 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 UeberlassungsmeldungMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, UeberlassungsmeldungMRTyp) 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 UeberlassungsmeldungMRTyp) 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 UeberlassungsmeldungMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class EinzelUeberlassungsmeldungTyp #Region "Private fields" Private _objektIdentifizierung As ObjektIdentifizierungMRTyp Private _kopfDaten As KopfDatenUeberlassungsmeldungTyp Private _warenPosition As List(Of WarenPositionUeberlassungsmeldungTyp) Private _transitOperation As TransitOperationMRType Private _attachments As List(Of AttachmentMRType) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._attachments = New List(Of AttachmentMRType)() Me._transitOperation = New TransitOperationMRType() Me._warenPosition = New List(Of WarenPositionUeberlassungsmeldungTyp)() Me._kopfDaten = New KopfDatenUeberlassungsmeldungTyp() Me._objektIdentifizierung = New ObjektIdentifizierungMRTyp() End Sub Public Property ObjektIdentifizierung() As ObjektIdentifizierungMRTyp Get Return Me._objektIdentifizierung End Get Set Me._objektIdentifizierung = Value End Set End Property Public Property KopfDaten() As KopfDatenUeberlassungsmeldungTyp Get Return Me._kopfDaten End Get Set Me._kopfDaten = Value End Set End Property Public Property WarenPosition() As List(Of WarenPositionUeberlassungsmeldungTyp) Get Return Me._warenPosition End Get Set Me._warenPosition = Value End Set End Property Public Property TransitOperation() As TransitOperationMRType Get Return Me._transitOperation End Get Set Me._transitOperation = Value End Set End Property Public Property Attachments() As List(Of AttachmentMRType) Get Return Me._attachments End Get Set Me._attachments = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(EinzelUeberlassungsmeldungTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize EinzelUeberlassungsmeldungTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes EinzelUeberlassungsmeldungTyp object ''' ''' string to deserialize ''' Output EinzelUeberlassungsmeldungTyp 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 EinzelUeberlassungsmeldungTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, EinzelUeberlassungsmeldungTyp) 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 EinzelUeberlassungsmeldungTyp) 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 EinzelUeberlassungsmeldungTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), EinzelUeberlassungsmeldungTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As EinzelUeberlassungsmeldungTyp Return CType(SerializerXml.Deserialize(s), EinzelUeberlassungsmeldungTyp) End Function #End Region ''' ''' Serializes current EinzelUeberlassungsmeldungTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an EinzelUeberlassungsmeldungTyp object ''' ''' File to load and deserialize ''' Output EinzelUeberlassungsmeldungTyp 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 EinzelUeberlassungsmeldungTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, EinzelUeberlassungsmeldungTyp) 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 EinzelUeberlassungsmeldungTyp) 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 EinzelUeberlassungsmeldungTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class ObjektIdentifizierungMRTyp #Region "Private fields" Private _objektName As String Private _objektAlias As String Private _eDIFACTNachrichtenNr As String Private _zeitpunktEingang As Date Private _shipmentReferenz As String Private Shared _serializerXml As XmlSerializer #End Region Public Property ObjektName() As String Get Return Me._objektName End Get Set Me._objektName = Value End Set End Property Public Property ObjektAlias() As String Get Return Me._objektAlias End Get Set Me._objektAlias = Value End Set End Property Public Property EDIFACTNachrichtenNr() As String Get Return Me._eDIFACTNachrichtenNr End Get Set Me._eDIFACTNachrichtenNr = Value End Set End Property Public Property ZeitpunktEingang() As Date Get Return Me._zeitpunktEingang End Get Set Me._zeitpunktEingang = Value End Set End Property Public Property ShipmentReferenz() As String Get Return Me._shipmentReferenz End Get Set Me._shipmentReferenz = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ObjektIdentifizierungMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ObjektIdentifizierungMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes ObjektIdentifizierungMRTyp object ''' ''' string to deserialize ''' Output ObjektIdentifizierungMRTyp 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 ObjektIdentifizierungMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ObjektIdentifizierungMRTyp) 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 ObjektIdentifizierungMRTyp) 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 ObjektIdentifizierungMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ObjektIdentifizierungMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As ObjektIdentifizierungMRTyp Return CType(SerializerXml.Deserialize(s), ObjektIdentifizierungMRTyp) End Function #End Region ''' ''' Serializes current ObjektIdentifizierungMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an ObjektIdentifizierungMRTyp object ''' ''' File to load and deserialize ''' Output ObjektIdentifizierungMRTyp 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 ObjektIdentifizierungMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ObjektIdentifizierungMRTyp) 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 ObjektIdentifizierungMRTyp) 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 ObjektIdentifizierungMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class AttachmentMRType #Region "Private fields" Private _technicalContent As String Private _originalFilename As String Private _fileFormat As String Private _dataEncoding As String Private _data As String Private Shared _serializerXml As XmlSerializer #End Region Public Property TechnicalContent() As String Get Return Me._technicalContent End Get Set Me._technicalContent = Value End Set End Property Public Property OriginalFilename() As String Get Return Me._originalFilename End Get Set Me._originalFilename = Value End Set End Property Public Property FileFormat() As String Get Return Me._fileFormat End Get Set Me._fileFormat = Value End Set End Property Public Property DataEncoding() As String Get Return Me._dataEncoding End Get Set Me._dataEncoding = Value End Set End Property Public Property Data() As String Get Return Me._data End Get Set Me._data = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AttachmentMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AttachmentMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes AttachmentMRType object ''' ''' string to deserialize ''' Output AttachmentMRType 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 AttachmentMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AttachmentMRType) 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 AttachmentMRType) 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 AttachmentMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AttachmentMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As AttachmentMRType Return CType(SerializerXml.Deserialize(s), AttachmentMRType) End Function #End Region ''' ''' Serializes current AttachmentMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an AttachmentMRType object ''' ''' File to load and deserialize ''' Output AttachmentMRType 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 AttachmentMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AttachmentMRType) 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 AttachmentMRType) 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 AttachmentMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class InwardProcessingGoodsReferenceMRType #Region "Private fields" Private _sequenceNumber As String Private _accessViaATLAS As String Private _registrationNumber As String Private _deprecatedFurtherRegistrationnumber As String Private _goodsItemNumber As String Private _goodsRelatedData As String Private Shared _serializerXml As XmlSerializer #End Region Public Property SequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = Value End Set End Property Public Property AccessViaATLAS() As String Get Return Me._accessViaATLAS End Get Set Me._accessViaATLAS = Value End Set End Property Public Property RegistrationNumber() As String Get Return Me._registrationNumber End Get Set Me._registrationNumber = Value End Set End Property Public Property DeprecatedFurtherRegistrationnumber() As String Get Return Me._deprecatedFurtherRegistrationnumber End Get Set Me._deprecatedFurtherRegistrationnumber = Value End Set End Property Public Property GoodsItemNumber() As String Get Return Me._goodsItemNumber End Get Set Me._goodsItemNumber = Value End Set End Property Public Property GoodsRelatedData() As String Get Return Me._goodsRelatedData End Get Set Me._goodsRelatedData = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(InwardProcessingGoodsReferenceMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize InwardProcessingGoodsReferenceMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes InwardProcessingGoodsReferenceMRType object ''' ''' string to deserialize ''' Output InwardProcessingGoodsReferenceMRType 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 InwardProcessingGoodsReferenceMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, InwardProcessingGoodsReferenceMRType) 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 InwardProcessingGoodsReferenceMRType) 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 InwardProcessingGoodsReferenceMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), InwardProcessingGoodsReferenceMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As InwardProcessingGoodsReferenceMRType Return CType(SerializerXml.Deserialize(s), InwardProcessingGoodsReferenceMRType) End Function #End Region ''' ''' Serializes current InwardProcessingGoodsReferenceMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an InwardProcessingGoodsReferenceMRType object ''' ''' File to load and deserialize ''' Output InwardProcessingGoodsReferenceMRType 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 InwardProcessingGoodsReferenceMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, InwardProcessingGoodsReferenceMRType) 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 InwardProcessingGoodsReferenceMRType) 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 InwardProcessingGoodsReferenceMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class InwardProcessingMRType #Region "Private fields" Private _transference As String Private _typeOfAuthorisation As String Private _referenceNumberOfAuthorisation As String Private _simplyGrantedAuthorisation As String Private _customsOfficeOfSupervision As String Private _inwardProcessingGoodsReference As List(Of InwardProcessingGoodsReferenceMRType) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._inwardProcessingGoodsReference = New List(Of InwardProcessingGoodsReferenceMRType)() End Sub Public Property Transference() As String Get Return Me._transference End Get Set Me._transference = Value End Set End Property Public Property TypeOfAuthorisation() As String Get Return Me._typeOfAuthorisation End Get Set Me._typeOfAuthorisation = Value End Set End Property Public Property ReferenceNumberOfAuthorisation() As String Get Return Me._referenceNumberOfAuthorisation End Get Set Me._referenceNumberOfAuthorisation = Value End Set End Property Public Property SimplyGrantedAuthorisation() As String Get Return Me._simplyGrantedAuthorisation End Get Set Me._simplyGrantedAuthorisation = Value End Set End Property Public Property CustomsOfficeOfSupervision() As String Get Return Me._customsOfficeOfSupervision End Get Set Me._customsOfficeOfSupervision = Value End Set End Property Public Property InwardProcessingGoodsReference() As List(Of InwardProcessingGoodsReferenceMRType) Get Return Me._inwardProcessingGoodsReference End Get Set Me._inwardProcessingGoodsReference = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(InwardProcessingMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize InwardProcessingMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes InwardProcessingMRType object ''' ''' string to deserialize ''' Output InwardProcessingMRType 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 InwardProcessingMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, InwardProcessingMRType) 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 InwardProcessingMRType) 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 InwardProcessingMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), InwardProcessingMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As InwardProcessingMRType Return CType(SerializerXml.Deserialize(s), InwardProcessingMRType) End Function #End Region ''' ''' Serializes current InwardProcessingMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an InwardProcessingMRType object ''' ''' File to load and deserialize ''' Output InwardProcessingMRType 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 InwardProcessingMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, InwardProcessingMRType) 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 InwardProcessingMRType) 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 InwardProcessingMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class GoodsReductionAfterTreatmentMRType #Region "Private fields" Private _quantityOfGoodsReductionAfterTreatment As Decimal Private _measurementUnitOfGoodsReductionAfterTreatment As String Private _qualifierOfGoodsReductionAfterTreatment As String Private Shared _serializerXml As XmlSerializer #End Region Public Property QuantityOfGoodsReductionAfterTreatment() As Decimal Get Return Me._quantityOfGoodsReductionAfterTreatment End Get Set Me._quantityOfGoodsReductionAfterTreatment = Value End Set End Property Public Property MeasurementUnitOfGoodsReductionAfterTreatment() As String Get Return Me._measurementUnitOfGoodsReductionAfterTreatment End Get Set Me._measurementUnitOfGoodsReductionAfterTreatment = Value End Set End Property Public Property QualifierOfGoodsReductionAfterTreatment() As String Get Return Me._qualifierOfGoodsReductionAfterTreatment End Get Set Me._qualifierOfGoodsReductionAfterTreatment = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(GoodsReductionAfterTreatmentMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize GoodsReductionAfterTreatmentMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes GoodsReductionAfterTreatmentMRType object ''' ''' string to deserialize ''' Output GoodsReductionAfterTreatmentMRType 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 GoodsReductionAfterTreatmentMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GoodsReductionAfterTreatmentMRType) 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 GoodsReductionAfterTreatmentMRType) 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 GoodsReductionAfterTreatmentMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), GoodsReductionAfterTreatmentMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As GoodsReductionAfterTreatmentMRType Return CType(SerializerXml.Deserialize(s), GoodsReductionAfterTreatmentMRType) End Function #End Region ''' ''' Serializes current GoodsReductionAfterTreatmentMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an GoodsReductionAfterTreatmentMRType object ''' ''' File to load and deserialize ''' Output GoodsReductionAfterTreatmentMRType 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 GoodsReductionAfterTreatmentMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GoodsReductionAfterTreatmentMRType) 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 GoodsReductionAfterTreatmentMRType) 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 GoodsReductionAfterTreatmentMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class GoodsReductionMRType #Region "Private fields" Private _quantityOfGoodsReduction As Decimal Private _measurementUnitOfGoodsReduction As String Private _qualifierOfGoodsReduction As String Private Shared _serializerXml As XmlSerializer #End Region Public Property QuantityOfGoodsReduction() As Decimal Get Return Me._quantityOfGoodsReduction End Get Set Me._quantityOfGoodsReduction = Value End Set End Property Public Property MeasurementUnitOfGoodsReduction() As String Get Return Me._measurementUnitOfGoodsReduction End Get Set Me._measurementUnitOfGoodsReduction = Value End Set End Property Public Property QualifierOfGoodsReduction() As String Get Return Me._qualifierOfGoodsReduction End Get Set Me._qualifierOfGoodsReduction = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(GoodsReductionMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize GoodsReductionMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes GoodsReductionMRType object ''' ''' string to deserialize ''' Output GoodsReductionMRType 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 GoodsReductionMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GoodsReductionMRType) 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 GoodsReductionMRType) 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 GoodsReductionMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), GoodsReductionMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As GoodsReductionMRType Return CType(SerializerXml.Deserialize(s), GoodsReductionMRType) End Function #End Region ''' ''' Serializes current GoodsReductionMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an GoodsReductionMRType object ''' ''' File to load and deserialize ''' Output GoodsReductionMRType 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 GoodsReductionMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GoodsReductionMRType) 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 GoodsReductionMRType) 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 GoodsReductionMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class CustomsWarehousingGoodsReferenceMRType #Region "Private fields" Private _sequenceNumber As String Private _commodityCode As String Private _accessViaATLAS As String Private _usualTreatment As String Private _registrationNumber As String Private _deprecatedFurtherRegistrationnumber As String Private _goodsItemNumber As String Private _complement As String Private _goodsReduction As GoodsReductionMRType Private _goodsReductionAfterTreatment As GoodsReductionAfterTreatmentMRType Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._goodsReductionAfterTreatment = New GoodsReductionAfterTreatmentMRType() Me._goodsReduction = New GoodsReductionMRType() End Sub Public Property SequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = Value End Set End Property Public Property CommodityCode() As String Get Return Me._commodityCode End Get Set Me._commodityCode = Value End Set End Property Public Property AccessViaATLAS() As String Get Return Me._accessViaATLAS End Get Set Me._accessViaATLAS = Value End Set End Property Public Property UsualTreatment() As String Get Return Me._usualTreatment End Get Set Me._usualTreatment = Value End Set End Property Public Property RegistrationNumber() As String Get Return Me._registrationNumber End Get Set Me._registrationNumber = Value End Set End Property Public Property DeprecatedFurtherRegistrationnumber() As String Get Return Me._deprecatedFurtherRegistrationnumber End Get Set Me._deprecatedFurtherRegistrationnumber = Value End Set End Property Public Property GoodsItemNumber() As String Get Return Me._goodsItemNumber End Get Set Me._goodsItemNumber = Value End Set End Property Public Property Complement() As String Get Return Me._complement End Get Set Me._complement = Value End Set End Property Public Property GoodsReduction() As GoodsReductionMRType Get Return Me._goodsReduction End Get Set Me._goodsReduction = Value End Set End Property Public Property GoodsReductionAfterTreatment() As GoodsReductionAfterTreatmentMRType Get Return Me._goodsReductionAfterTreatment End Get Set Me._goodsReductionAfterTreatment = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CustomsWarehousingGoodsReferenceMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize CustomsWarehousingGoodsReferenceMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes CustomsWarehousingGoodsReferenceMRType object ''' ''' string to deserialize ''' Output CustomsWarehousingGoodsReferenceMRType 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 CustomsWarehousingGoodsReferenceMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CustomsWarehousingGoodsReferenceMRType) 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 CustomsWarehousingGoodsReferenceMRType) 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 CustomsWarehousingGoodsReferenceMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CustomsWarehousingGoodsReferenceMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As CustomsWarehousingGoodsReferenceMRType Return CType(SerializerXml.Deserialize(s), CustomsWarehousingGoodsReferenceMRType) End Function #End Region ''' ''' Serializes current CustomsWarehousingGoodsReferenceMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an CustomsWarehousingGoodsReferenceMRType object ''' ''' File to load and deserialize ''' Output CustomsWarehousingGoodsReferenceMRType 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 CustomsWarehousingGoodsReferenceMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CustomsWarehousingGoodsReferenceMRType) 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 CustomsWarehousingGoodsReferenceMRType) 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 CustomsWarehousingGoodsReferenceMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class CustomsWarehousingMRType #Region "Private fields" Private _lRN As String Private _transference As String Private _typeOfAuthorisation As String Private _referenceNumberOfAuthorisation As String Private _customsWarehousingGoodsReference As List(Of CustomsWarehousingGoodsReferenceMRType) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._customsWarehousingGoodsReference = New List(Of CustomsWarehousingGoodsReferenceMRType)() End Sub Public Property LRN() As String Get Return Me._lRN End Get Set Me._lRN = Value End Set End Property Public Property Transference() As String Get Return Me._transference End Get Set Me._transference = Value End Set End Property Public Property TypeOfAuthorisation() As String Get Return Me._typeOfAuthorisation End Get Set Me._typeOfAuthorisation = Value End Set End Property Public Property ReferenceNumberOfAuthorisation() As String Get Return Me._referenceNumberOfAuthorisation End Get Set Me._referenceNumberOfAuthorisation = Value End Set End Property Public Property CustomsWarehousingGoodsReference() As List(Of CustomsWarehousingGoodsReferenceMRType) Get Return Me._customsWarehousingGoodsReference End Get Set Me._customsWarehousingGoodsReference = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CustomsWarehousingMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize CustomsWarehousingMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes CustomsWarehousingMRType object ''' ''' string to deserialize ''' Output CustomsWarehousingMRType 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 CustomsWarehousingMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CustomsWarehousingMRType) 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 CustomsWarehousingMRType) 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 CustomsWarehousingMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CustomsWarehousingMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As CustomsWarehousingMRType Return CType(SerializerXml.Deserialize(s), CustomsWarehousingMRType) End Function #End Region ''' ''' Serializes current CustomsWarehousingMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an CustomsWarehousingMRType object ''' ''' File to load and deserialize ''' Output CustomsWarehousingMRType 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 CustomsWarehousingMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CustomsWarehousingMRType) 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 CustomsWarehousingMRType) 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 CustomsWarehousingMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class SummaryDeclarationGoodsReferenceMRType #Region "Private fields" Private _sequenceNumber As String Private _numberOfPackages As String Private _registrationNumber As String Private _deprecatedFurtherRegistrationnumber As String Private _goodsItemNumber As String Private _identificationNumberOfCustodian As String Private _typeOfIdentificationByKey As String Private _referenceNumberOfIdentificationByKey As String Private Shared _serializerXml As XmlSerializer #End Region Public Property SequenceNumber() As String Get Return Me._sequenceNumber End Get Set Me._sequenceNumber = Value End Set End Property Public Property NumberOfPackages() As String Get Return Me._numberOfPackages End Get Set Me._numberOfPackages = Value End Set End Property Public Property RegistrationNumber() As String Get Return Me._registrationNumber End Get Set Me._registrationNumber = Value End Set End Property Public Property DeprecatedFurtherRegistrationnumber() As String Get Return Me._deprecatedFurtherRegistrationnumber End Get Set Me._deprecatedFurtherRegistrationnumber = Value End Set End Property Public Property GoodsItemNumber() As String Get Return Me._goodsItemNumber End Get Set Me._goodsItemNumber = Value End Set End Property Public Property IdentificationNumberOfCustodian() As String Get Return Me._identificationNumberOfCustodian End Get Set Me._identificationNumberOfCustodian = Value End Set End Property Public Property TypeOfIdentificationByKey() As String Get Return Me._typeOfIdentificationByKey End Get Set Me._typeOfIdentificationByKey = Value End Set End Property Public Property ReferenceNumberOfIdentificationByKey() As String Get Return Me._referenceNumberOfIdentificationByKey End Get Set Me._referenceNumberOfIdentificationByKey = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SummaryDeclarationGoodsReferenceMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize SummaryDeclarationGoodsReferenceMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes SummaryDeclarationGoodsReferenceMRType object ''' ''' string to deserialize ''' Output SummaryDeclarationGoodsReferenceMRType 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 SummaryDeclarationGoodsReferenceMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SummaryDeclarationGoodsReferenceMRType) 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 SummaryDeclarationGoodsReferenceMRType) 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 SummaryDeclarationGoodsReferenceMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SummaryDeclarationGoodsReferenceMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As SummaryDeclarationGoodsReferenceMRType Return CType(SerializerXml.Deserialize(s), SummaryDeclarationGoodsReferenceMRType) End Function #End Region ''' ''' Serializes current SummaryDeclarationGoodsReferenceMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an SummaryDeclarationGoodsReferenceMRType object ''' ''' File to load and deserialize ''' Output SummaryDeclarationGoodsReferenceMRType 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 SummaryDeclarationGoodsReferenceMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SummaryDeclarationGoodsReferenceMRType) 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 SummaryDeclarationGoodsReferenceMRType) 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 SummaryDeclarationGoodsReferenceMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class SummaryDeclarationMRType #Region "Private fields" Private _transference As String Private _identificationType As String Private _summaryDeclarationGoodsReference As List(Of SummaryDeclarationGoodsReferenceMRType) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._summaryDeclarationGoodsReference = New List(Of SummaryDeclarationGoodsReferenceMRType)() End Sub Public Property Transference() As String Get Return Me._transference End Get Set Me._transference = Value End Set End Property Public Property IdentificationType() As String Get Return Me._identificationType End Get Set Me._identificationType = Value End Set End Property Public Property SummaryDeclarationGoodsReference() As List(Of SummaryDeclarationGoodsReferenceMRType) Get Return Me._summaryDeclarationGoodsReference End Get Set Me._summaryDeclarationGoodsReference = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SummaryDeclarationMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize SummaryDeclarationMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes SummaryDeclarationMRType object ''' ''' string to deserialize ''' Output SummaryDeclarationMRType 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 SummaryDeclarationMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SummaryDeclarationMRType) 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 SummaryDeclarationMRType) 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 SummaryDeclarationMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SummaryDeclarationMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As SummaryDeclarationMRType Return CType(SerializerXml.Deserialize(s), SummaryDeclarationMRType) End Function #End Region ''' ''' Serializes current SummaryDeclarationMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an SummaryDeclarationMRType object ''' ''' File to load and deserialize ''' Output SummaryDeclarationMRType 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 SummaryDeclarationMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SummaryDeclarationMRType) 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 SummaryDeclarationMRType) 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 SummaryDeclarationMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class ProcedureTransferenceMRType #Region "Private fields" Private _summaryDeclaration As SummaryDeclarationMRType Private _customsWarehousing As CustomsWarehousingMRType Private _inwardProcessing As InwardProcessingMRType Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._inwardProcessing = New InwardProcessingMRType() Me._customsWarehousing = New CustomsWarehousingMRType() Me._summaryDeclaration = New SummaryDeclarationMRType() End Sub Public Property SummaryDeclaration() As SummaryDeclarationMRType Get Return Me._summaryDeclaration End Get Set Me._summaryDeclaration = Value End Set End Property Public Property CustomsWarehousing() As CustomsWarehousingMRType Get Return Me._customsWarehousing End Get Set Me._customsWarehousing = Value End Set End Property Public Property InwardProcessing() As InwardProcessingMRType Get Return Me._inwardProcessing End Get Set Me._inwardProcessing = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ProcedureTransferenceMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ProcedureTransferenceMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes ProcedureTransferenceMRType object ''' ''' string to deserialize ''' Output ProcedureTransferenceMRType 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 ProcedureTransferenceMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ProcedureTransferenceMRType) 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 ProcedureTransferenceMRType) 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 ProcedureTransferenceMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ProcedureTransferenceMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As ProcedureTransferenceMRType Return CType(SerializerXml.Deserialize(s), ProcedureTransferenceMRType) End Function #End Region ''' ''' Serializes current ProcedureTransferenceMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an ProcedureTransferenceMRType object ''' ''' File to load and deserialize ''' Output ProcedureTransferenceMRType 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 ProcedureTransferenceMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ProcedureTransferenceMRType) 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 ProcedureTransferenceMRType) 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 ProcedureTransferenceMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class PackagingMRType #Region "Private fields" Private _numberOfPackages As String Private _typeOfPackages As String Private _shippingMarks As String Private _goodsItemNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property NumberOfPackages() As String Get Return Me._numberOfPackages End Get Set Me._numberOfPackages = Value End Set End Property Public Property TypeOfPackages() As String Get Return Me._typeOfPackages End Get Set Me._typeOfPackages = Value End Set End Property Public Property ShippingMarks() As String Get Return Me._shippingMarks End Get Set Me._shippingMarks = Value End Set End Property Public Property GoodsItemNumber() As String Get Return Me._goodsItemNumber End Get Set Me._goodsItemNumber = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PackagingMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize PackagingMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes PackagingMRType object ''' ''' string to deserialize ''' Output PackagingMRType 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 PackagingMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PackagingMRType) 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 PackagingMRType) 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 PackagingMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PackagingMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As PackagingMRType Return CType(SerializerXml.Deserialize(s), PackagingMRType) End Function #End Region ''' ''' Serializes current PackagingMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an PackagingMRType object ''' ''' File to load and deserialize ''' Output PackagingMRType 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 PackagingMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PackagingMRType) 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 PackagingMRType) 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 PackagingMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class PreviousDocumentItemMRType #Region "Private fields" Private _type As String Private _referenceNumber As String Private _goodsItemNumber As String Private _complementOfInformation As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Type() As String Get Return Me._type End Get Set Me._type = Value End Set End Property Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set Me._referenceNumber = Value End Set End Property Public Property GoodsItemNumber() As String Get Return Me._goodsItemNumber End Get Set Me._goodsItemNumber = Value End Set End Property Public Property ComplementOfInformation() As String Get Return Me._complementOfInformation End Get Set Me._complementOfInformation = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PreviousDocumentItemMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize PreviousDocumentItemMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes PreviousDocumentItemMRType object ''' ''' string to deserialize ''' Output PreviousDocumentItemMRType 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 PreviousDocumentItemMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PreviousDocumentItemMRType) 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 PreviousDocumentItemMRType) 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 PreviousDocumentItemMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PreviousDocumentItemMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As PreviousDocumentItemMRType Return CType(SerializerXml.Deserialize(s), PreviousDocumentItemMRType) End Function #End Region ''' ''' Serializes current PreviousDocumentItemMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an PreviousDocumentItemMRType object ''' ''' File to load and deserialize ''' Output PreviousDocumentItemMRType 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 PreviousDocumentItemMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PreviousDocumentItemMRType) 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 PreviousDocumentItemMRType) 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 PreviousDocumentItemMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class ConsignmentItemMRType #Region "Private fields" Private _goodsItemNumber As String Private _declarationGoodsItemNumber As String Private _declarationType As String Private _countryOfDispatch As String Private _countryOfDestination As String Private _commodityCode As String Private _commodityCodeCombinedNomenclature As String Private _referenceNumberUCR As String Private _methodOfPayment As String Private _uNNumber As List(Of String) Private _descriptionOfGoods As String Private _cusCode As String Private _grossMass As Decimal Private _netMass As Decimal Private _consignee As AddressMRType Private _additionalSupplyChainActor As List(Of AdditionalSupplyChainActorMRType) Private _previousDocument As List(Of PreviousDocumentItemMRType) Private _packaging As List(Of PackagingMRType) Private _supportingDocument As List(Of SupportingDocumentMRType) Private _transportDocument As List(Of TransportDocumentMRType) Private _additionalReference As List(Of AdditionalReferenceMRType) Private _additionalInformation As List(Of AdditionalInformationMRType) Private _procedureTransference As ProcedureTransferenceMRType Private _applicationInternalData As ApplicationInternalDataType Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._applicationInternalData = New ApplicationInternalDataType() Me._procedureTransference = New ProcedureTransferenceMRType() Me._additionalInformation = New List(Of AdditionalInformationMRType)() Me._additionalReference = New List(Of AdditionalReferenceMRType)() Me._transportDocument = New List(Of TransportDocumentMRType)() Me._supportingDocument = New List(Of SupportingDocumentMRType)() Me._packaging = New List(Of PackagingMRType)() Me._previousDocument = New List(Of PreviousDocumentItemMRType)() Me._additionalSupplyChainActor = New List(Of AdditionalSupplyChainActorMRType)() Me._consignee = New AddressMRType() Me._uNNumber = New List(Of String)() End Sub Public Property GoodsItemNumber() As String Get Return Me._goodsItemNumber End Get Set Me._goodsItemNumber = Value End Set End Property Public Property DeclarationGoodsItemNumber() As String Get Return Me._declarationGoodsItemNumber End Get Set Me._declarationGoodsItemNumber = Value End Set End Property Public Property DeclarationType() As String Get Return Me._declarationType End Get Set Me._declarationType = Value End Set End Property Public Property CountryOfDispatch() As String Get Return Me._countryOfDispatch End Get Set Me._countryOfDispatch = Value End Set End Property Public Property CountryOfDestination() As String Get Return Me._countryOfDestination End Get Set Me._countryOfDestination = Value End Set End Property Public Property CommodityCode() As String Get Return Me._commodityCode End Get Set Me._commodityCode = Value End Set End Property Public Property CommodityCodeCombinedNomenclature() As String Get Return Me._commodityCodeCombinedNomenclature End Get Set Me._commodityCodeCombinedNomenclature = Value End Set End Property Public Property ReferenceNumberUCR() As String Get Return Me._referenceNumberUCR End Get Set Me._referenceNumberUCR = Value End Set End Property Public Property MethodOfPayment() As String Get Return Me._methodOfPayment End Get Set Me._methodOfPayment = Value End Set End Property Public Property UNNumber() As List(Of String) Get Return Me._uNNumber End Get Set Me._uNNumber = Value End Set End Property Public Property DescriptionOfGoods() As String Get Return Me._descriptionOfGoods End Get Set Me._descriptionOfGoods = Value End Set End Property Public Property CusCode() As String Get Return Me._cusCode End Get Set Me._cusCode = Value End Set End Property Public Property GrossMass() As Decimal Get Return Me._grossMass End Get Set Me._grossMass = Value End Set End Property Public Property NetMass() As Decimal Get Return Me._netMass End Get Set Me._netMass = Value End Set End Property Public Property Consignee() As AddressMRType Get Return Me._consignee End Get Set Me._consignee = Value End Set End Property Public Property AdditionalSupplyChainActor() As List(Of AdditionalSupplyChainActorMRType) Get Return Me._additionalSupplyChainActor End Get Set Me._additionalSupplyChainActor = Value End Set End Property Public Property PreviousDocument() As List(Of PreviousDocumentItemMRType) Get Return Me._previousDocument End Get Set Me._previousDocument = Value End Set End Property Public Property Packaging() As List(Of PackagingMRType) Get Return Me._packaging End Get Set Me._packaging = Value End Set End Property Public Property SupportingDocument() As List(Of SupportingDocumentMRType) Get Return Me._supportingDocument End Get Set Me._supportingDocument = Value End Set End Property Public Property TransportDocument() As List(Of TransportDocumentMRType) Get Return Me._transportDocument End Get Set Me._transportDocument = Value End Set End Property Public Property AdditionalReference() As List(Of AdditionalReferenceMRType) Get Return Me._additionalReference End Get Set Me._additionalReference = Value End Set End Property Public Property AdditionalInformation() As List(Of AdditionalInformationMRType) Get Return Me._additionalInformation End Get Set Me._additionalInformation = Value End Set End Property Public Property ProcedureTransference() As ProcedureTransferenceMRType Get Return Me._procedureTransference End Get Set Me._procedureTransference = Value End Set End Property Public Property ApplicationInternalData() As ApplicationInternalDataType Get Return Me._applicationInternalData End Get Set Me._applicationInternalData = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ConsignmentItemMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ConsignmentItemMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes ConsignmentItemMRType object ''' ''' string to deserialize ''' Output ConsignmentItemMRType 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 ConsignmentItemMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ConsignmentItemMRType) 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 ConsignmentItemMRType) 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 ConsignmentItemMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ConsignmentItemMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As ConsignmentItemMRType Return CType(SerializerXml.Deserialize(s), ConsignmentItemMRType) End Function #End Region ''' ''' Serializes current ConsignmentItemMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an ConsignmentItemMRType object ''' ''' File to load and deserialize ''' Output ConsignmentItemMRType 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 ConsignmentItemMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ConsignmentItemMRType) 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 ConsignmentItemMRType) 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 ConsignmentItemMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class AddressMRType #Region "Private fields" Private _identificationNumber As String Private _subsidiaryNumber As String Private _name As String Private _streetAndNumber As String Private _city As String Private _postcode As String Private _country As String Private _contactPerson As ContactPersonMRType Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._contactPerson = New ContactPersonMRType() End Sub Public Property IdentificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = Value End Set End Property Public Property SubsidiaryNumber() As String Get Return Me._subsidiaryNumber End Get Set Me._subsidiaryNumber = Value End Set End Property Public Property Name() As String Get Return Me._name End Get Set Me._name = Value End Set End Property Public Property StreetAndNumber() As String Get Return Me._streetAndNumber End Get Set Me._streetAndNumber = Value End Set End Property Public Property City() As String Get Return Me._city End Get Set Me._city = Value End Set End Property Public Property Postcode() As String Get Return Me._postcode End Get Set Me._postcode = Value End Set End Property Public Property Country() As String Get Return Me._country End Get Set Me._country = Value End Set End Property Public Property ContactPerson() As ContactPersonMRType Get Return Me._contactPerson End Get Set Me._contactPerson = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AddressMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AddressMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes AddressMRType object ''' ''' string to deserialize ''' Output AddressMRType 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 AddressMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AddressMRType) 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 AddressMRType) 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 AddressMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AddressMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As AddressMRType Return CType(SerializerXml.Deserialize(s), AddressMRType) End Function #End Region ''' ''' Serializes current AddressMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an AddressMRType object ''' ''' File to load and deserialize ''' Output AddressMRType 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 AddressMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AddressMRType) 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 AddressMRType) 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 AddressMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class ContactPersonMRType #Region "Private fields" Private _name As String Private _phoneNumber As String Private _eMailAddress As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Name() As String Get Return Me._name End Get Set Me._name = Value End Set End Property Public Property PhoneNumber() As String Get Return Me._phoneNumber End Get Set Me._phoneNumber = Value End Set End Property Public Property EMailAddress() As String Get Return Me._eMailAddress End Get Set Me._eMailAddress = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ContactPersonMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ContactPersonMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes ContactPersonMRType object ''' ''' string to deserialize ''' Output ContactPersonMRType 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 ContactPersonMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ContactPersonMRType) 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 ContactPersonMRType) 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 ContactPersonMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ContactPersonMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As ContactPersonMRType Return CType(SerializerXml.Deserialize(s), ContactPersonMRType) End Function #End Region ''' ''' Serializes current ContactPersonMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an ContactPersonMRType object ''' ''' File to load and deserialize ''' Output ContactPersonMRType 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 ContactPersonMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ContactPersonMRType) 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 ContactPersonMRType) 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 ContactPersonMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class AdditionalSupplyChainActorMRType #Region "Private fields" Private _role As String Private _identificationNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Role() As String Get Return Me._role End Get Set Me._role = Value End Set End Property Public Property IdentificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AdditionalSupplyChainActorMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AdditionalSupplyChainActorMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes AdditionalSupplyChainActorMRType object ''' ''' string to deserialize ''' Output AdditionalSupplyChainActorMRType 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 AdditionalSupplyChainActorMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalSupplyChainActorMRType) 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 AdditionalSupplyChainActorMRType) 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 AdditionalSupplyChainActorMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdditionalSupplyChainActorMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As AdditionalSupplyChainActorMRType Return CType(SerializerXml.Deserialize(s), AdditionalSupplyChainActorMRType) End Function #End Region ''' ''' Serializes current AdditionalSupplyChainActorMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an AdditionalSupplyChainActorMRType object ''' ''' File to load and deserialize ''' Output AdditionalSupplyChainActorMRType 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 AdditionalSupplyChainActorMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalSupplyChainActorMRType) 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 AdditionalSupplyChainActorMRType) 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 AdditionalSupplyChainActorMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class SupportingDocumentMRType #Region "Private fields" Private _type As String Private _referenceNumber As String Private _documentLineItemNumber As String Private _complementOfInformation As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Type() As String Get Return Me._type End Get Set Me._type = Value End Set End Property Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set Me._referenceNumber = Value End Set End Property Public Property DocumentLineItemNumber() As String Get Return Me._documentLineItemNumber End Get Set Me._documentLineItemNumber = Value End Set End Property Public Property ComplementOfInformation() As String Get Return Me._complementOfInformation End Get Set Me._complementOfInformation = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SupportingDocumentMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize SupportingDocumentMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes SupportingDocumentMRType object ''' ''' string to deserialize ''' Output SupportingDocumentMRType 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 SupportingDocumentMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SupportingDocumentMRType) 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 SupportingDocumentMRType) 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 SupportingDocumentMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SupportingDocumentMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As SupportingDocumentMRType Return CType(SerializerXml.Deserialize(s), SupportingDocumentMRType) End Function #End Region ''' ''' Serializes current SupportingDocumentMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an SupportingDocumentMRType object ''' ''' File to load and deserialize ''' Output SupportingDocumentMRType 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 SupportingDocumentMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SupportingDocumentMRType) 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 SupportingDocumentMRType) 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 SupportingDocumentMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class TransportDocumentMRType #Region "Private fields" Private _type As String Private _referenceNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Type() As String Get Return Me._type End Get Set Me._type = Value End Set End Property Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set Me._referenceNumber = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransportDocumentMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize TransportDocumentMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes TransportDocumentMRType object ''' ''' string to deserialize ''' Output TransportDocumentMRType 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 TransportDocumentMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransportDocumentMRType) 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 TransportDocumentMRType) 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 TransportDocumentMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransportDocumentMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As TransportDocumentMRType Return CType(SerializerXml.Deserialize(s), TransportDocumentMRType) End Function #End Region ''' ''' Serializes current TransportDocumentMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an TransportDocumentMRType object ''' ''' File to load and deserialize ''' Output TransportDocumentMRType 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 TransportDocumentMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransportDocumentMRType) 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 TransportDocumentMRType) 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 TransportDocumentMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class AdditionalReferenceMRType #Region "Private fields" Private _type As String Private _referenceNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Type() As String Get Return Me._type End Get Set Me._type = Value End Set End Property Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set Me._referenceNumber = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AdditionalReferenceMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AdditionalReferenceMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes AdditionalReferenceMRType object ''' ''' string to deserialize ''' Output AdditionalReferenceMRType 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 AdditionalReferenceMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalReferenceMRType) 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 AdditionalReferenceMRType) 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 AdditionalReferenceMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdditionalReferenceMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As AdditionalReferenceMRType Return CType(SerializerXml.Deserialize(s), AdditionalReferenceMRType) End Function #End Region ''' ''' Serializes current AdditionalReferenceMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an AdditionalReferenceMRType object ''' ''' File to load and deserialize ''' Output AdditionalReferenceMRType 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 AdditionalReferenceMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalReferenceMRType) 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 AdditionalReferenceMRType) 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 AdditionalReferenceMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class AdditionalInformationMRType #Region "Private fields" Private _code As String Private _text As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Code() As String Get Return Me._code End Get Set Me._code = Value End Set End Property Public Property Text() As String Get Return Me._text End Get Set Me._text = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AdditionalInformationMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AdditionalInformationMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes AdditionalInformationMRType object ''' ''' string to deserialize ''' Output AdditionalInformationMRType 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 AdditionalInformationMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalInformationMRType) 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 AdditionalInformationMRType) 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 AdditionalInformationMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdditionalInformationMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As AdditionalInformationMRType Return CType(SerializerXml.Deserialize(s), AdditionalInformationMRType) End Function #End Region ''' ''' Serializes current AdditionalInformationMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an AdditionalInformationMRType object ''' ''' File to load and deserialize ''' Output AdditionalInformationMRType 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 AdditionalInformationMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdditionalInformationMRType) 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 AdditionalInformationMRType) 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 AdditionalInformationMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class ApplicationInternalDataType #Region "Private fields" Private _additionalDetails As List(Of ApplicationInternalDataAdditionalDetailsDataType) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._additionalDetails = New List(Of ApplicationInternalDataAdditionalDetailsDataType)() End Sub Public Property AdditionalDetails() As List(Of ApplicationInternalDataAdditionalDetailsDataType) Get Return Me._additionalDetails End Get Set Me._additionalDetails = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ApplicationInternalDataType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ApplicationInternalDataType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes ApplicationInternalDataType object ''' ''' string to deserialize ''' Output ApplicationInternalDataType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ApplicationInternalDataType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ApplicationInternalDataType) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ApplicationInternalDataType) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As ApplicationInternalDataType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ApplicationInternalDataType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As ApplicationInternalDataType Return CType(SerializerXml.Deserialize(s), ApplicationInternalDataType) End Function #End Region ''' ''' Serializes current ApplicationInternalDataType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an ApplicationInternalDataType object ''' ''' File to load and deserialize ''' Output ApplicationInternalDataType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ApplicationInternalDataType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ApplicationInternalDataType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ApplicationInternalDataType) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As ApplicationInternalDataType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class ApplicationInternalDataAdditionalDetailsDataType #Region "Private fields" Private _key As String Private _value As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Key() As String Get Return Me._key End Get Set Me._key = Value End Set End Property Public Property Value() As String Get Return Me._value End Get Set Me._value = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ApplicationInternalDataAdditionalDetailsDataType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ApplicationInternalDataAdditionalDetailsDataType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes ApplicationInternalDataAdditionalDetailsDataType object ''' ''' string to deserialize ''' Output ApplicationInternalDataAdditionalDetailsDataType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ApplicationInternalDataAdditionalDetailsDataType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ApplicationInternalDataAdditionalDetailsDataType) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ApplicationInternalDataAdditionalDetailsDataType) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As ApplicationInternalDataAdditionalDetailsDataType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ApplicationInternalDataAdditionalDetailsDataType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As ApplicationInternalDataAdditionalDetailsDataType Return CType(SerializerXml.Deserialize(s), ApplicationInternalDataAdditionalDetailsDataType) End Function #End Region ''' ''' Serializes current ApplicationInternalDataAdditionalDetailsDataType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an ApplicationInternalDataAdditionalDetailsDataType object ''' ''' File to load and deserialize ''' Output ApplicationInternalDataAdditionalDetailsDataType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ApplicationInternalDataAdditionalDetailsDataType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ApplicationInternalDataAdditionalDetailsDataType) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ApplicationInternalDataAdditionalDetailsDataType) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As ApplicationInternalDataAdditionalDetailsDataType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class HouseConsignmentMRType #Region "Private fields" Private _houseConsignmentNumber As String Private _countryOfDispatch As String Private _countryOfDestination As String Private _grossMass As Decimal Private _referenceNumberUCR As String Private _consignor As AddressMRType Private _consignee As AddressMRType Private _additionalSupplyChainActor As List(Of AdditionalSupplyChainActorMRType) Private _previousDocument As List(Of PreviousDocumentMRType) Private _supportingDocument As List(Of SupportingDocumentMRType) Private _transportDocument As List(Of TransportDocumentMRType) Private _additionalReference As List(Of AdditionalReferenceMRType) Private _additionalInformation As List(Of AdditionalInformationMRType) Private _transportCharges As String Private _applicationInternalData As ApplicationInternalDataType Private _consignmentItem As List(Of ConsignmentItemMRType) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._consignmentItem = New List(Of ConsignmentItemMRType)() Me._applicationInternalData = New ApplicationInternalDataType() Me._additionalInformation = New List(Of AdditionalInformationMRType)() Me._additionalReference = New List(Of AdditionalReferenceMRType)() Me._transportDocument = New List(Of TransportDocumentMRType)() Me._supportingDocument = New List(Of SupportingDocumentMRType)() Me._previousDocument = New List(Of PreviousDocumentMRType)() Me._additionalSupplyChainActor = New List(Of AdditionalSupplyChainActorMRType)() Me._consignee = New AddressMRType() Me._consignor = New AddressMRType() End Sub Public Property HouseConsignmentNumber() As String Get Return Me._houseConsignmentNumber End Get Set Me._houseConsignmentNumber = Value End Set End Property Public Property CountryOfDispatch() As String Get Return Me._countryOfDispatch End Get Set Me._countryOfDispatch = Value End Set End Property Public Property CountryOfDestination() As String Get Return Me._countryOfDestination End Get Set Me._countryOfDestination = Value End Set End Property Public Property GrossMass() As Decimal Get Return Me._grossMass End Get Set Me._grossMass = Value End Set End Property Public Property ReferenceNumberUCR() As String Get Return Me._referenceNumberUCR End Get Set Me._referenceNumberUCR = Value End Set End Property Public Property Consignor() As AddressMRType Get Return Me._consignor End Get Set Me._consignor = Value End Set End Property Public Property Consignee() As AddressMRType Get Return Me._consignee End Get Set Me._consignee = Value End Set End Property Public Property AdditionalSupplyChainActor() As List(Of AdditionalSupplyChainActorMRType) Get Return Me._additionalSupplyChainActor End Get Set Me._additionalSupplyChainActor = Value End Set End Property Public Property PreviousDocument() As List(Of PreviousDocumentMRType) Get Return Me._previousDocument End Get Set Me._previousDocument = Value End Set End Property Public Property SupportingDocument() As List(Of SupportingDocumentMRType) Get Return Me._supportingDocument End Get Set Me._supportingDocument = Value End Set End Property Public Property TransportDocument() As List(Of TransportDocumentMRType) Get Return Me._transportDocument End Get Set Me._transportDocument = Value End Set End Property Public Property AdditionalReference() As List(Of AdditionalReferenceMRType) Get Return Me._additionalReference End Get Set Me._additionalReference = Value End Set End Property Public Property AdditionalInformation() As List(Of AdditionalInformationMRType) Get Return Me._additionalInformation End Get Set Me._additionalInformation = Value End Set End Property Public Property TransportCharges() As String Get Return Me._transportCharges End Get Set Me._transportCharges = Value End Set End Property Public Property ApplicationInternalData() As ApplicationInternalDataType Get Return Me._applicationInternalData End Get Set Me._applicationInternalData = Value End Set End Property Public Property ConsignmentItem() As List(Of ConsignmentItemMRType) Get Return Me._consignmentItem End Get Set Me._consignmentItem = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(HouseConsignmentMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize HouseConsignmentMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes HouseConsignmentMRType object ''' ''' string to deserialize ''' Output HouseConsignmentMRType 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 HouseConsignmentMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, HouseConsignmentMRType) 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 HouseConsignmentMRType) 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 HouseConsignmentMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HouseConsignmentMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As HouseConsignmentMRType Return CType(SerializerXml.Deserialize(s), HouseConsignmentMRType) End Function #End Region ''' ''' Serializes current HouseConsignmentMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an HouseConsignmentMRType object ''' ''' File to load and deserialize ''' Output HouseConsignmentMRType 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 HouseConsignmentMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, HouseConsignmentMRType) 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 HouseConsignmentMRType) 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 HouseConsignmentMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class PreviousDocumentMRType #Region "Private fields" Private _type As String Private _referenceNumber As String Private _complementOfInformation As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Type() As String Get Return Me._type End Get Set Me._type = Value End Set End Property Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set Me._referenceNumber = Value End Set End Property Public Property ComplementOfInformation() As String Get Return Me._complementOfInformation End Get Set Me._complementOfInformation = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PreviousDocumentMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize PreviousDocumentMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes PreviousDocumentMRType object ''' ''' string to deserialize ''' Output PreviousDocumentMRType 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 PreviousDocumentMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PreviousDocumentMRType) 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 PreviousDocumentMRType) 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 PreviousDocumentMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PreviousDocumentMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As PreviousDocumentMRType Return CType(SerializerXml.Deserialize(s), PreviousDocumentMRType) End Function #End Region ''' ''' Serializes current PreviousDocumentMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an PreviousDocumentMRType object ''' ''' File to load and deserialize ''' Output PreviousDocumentMRType 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 PreviousDocumentMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PreviousDocumentMRType) 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 PreviousDocumentMRType) 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 PreviousDocumentMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class LocationOfGoodsMRType #Region "Private fields" Private _typeOfLocation As String Private _qualifierOfIdentification As String Private _additionalIdentifier As String Private _contactPerson As ContactPersonMRType Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._contactPerson = New ContactPersonMRType() End Sub Public Property TypeOfLocation() As String Get Return Me._typeOfLocation End Get Set Me._typeOfLocation = Value End Set End Property Public Property QualifierOfIdentification() As String Get Return Me._qualifierOfIdentification End Get Set Me._qualifierOfIdentification = Value End Set End Property Public Property AdditionalIdentifier() As String Get Return Me._additionalIdentifier End Get Set Me._additionalIdentifier = Value End Set End Property Public Property ContactPerson() As ContactPersonMRType Get Return Me._contactPerson End Get Set Me._contactPerson = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(LocationOfGoodsMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize LocationOfGoodsMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes LocationOfGoodsMRType object ''' ''' string to deserialize ''' Output LocationOfGoodsMRType 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 LocationOfGoodsMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, LocationOfGoodsMRType) 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 LocationOfGoodsMRType) 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 LocationOfGoodsMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), LocationOfGoodsMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As LocationOfGoodsMRType Return CType(SerializerXml.Deserialize(s), LocationOfGoodsMRType) End Function #End Region ''' ''' Serializes current LocationOfGoodsMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an LocationOfGoodsMRType object ''' ''' File to load and deserialize ''' Output LocationOfGoodsMRType 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 LocationOfGoodsMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, LocationOfGoodsMRType) 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 LocationOfGoodsMRType) 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 LocationOfGoodsMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class AuthorisationMRType #Region "Private fields" Private _referenceNumber As String Private _type As String Private Shared _serializerXml As XmlSerializer #End Region Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set Me._referenceNumber = Value End Set End Property Public Property Type() As String Get Return Me._type End Get Set Me._type = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AuthorisationMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AuthorisationMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes AuthorisationMRType object ''' ''' string to deserialize ''' Output AuthorisationMRType 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 AuthorisationMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AuthorisationMRType) 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 AuthorisationMRType) 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 AuthorisationMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AuthorisationMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As AuthorisationMRType Return CType(SerializerXml.Deserialize(s), AuthorisationMRType) End Function #End Region ''' ''' Serializes current AuthorisationMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an AuthorisationMRType object ''' ''' File to load and deserialize ''' Output AuthorisationMRType 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 AuthorisationMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AuthorisationMRType) 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 AuthorisationMRType) 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 AuthorisationMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class TransportEquipmentMRType #Region "Private fields" Private _numberOfSeals As String Private _seal As List(Of String) Private _containerIdentificationNumber As String Private _goodsReference As List(Of String) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._goodsReference = New List(Of String)() Me._seal = New List(Of String)() End Sub Public Property NumberOfSeals() As String Get Return Me._numberOfSeals End Get Set Me._numberOfSeals = Value End Set End Property Public Property Seal() As List(Of String) Get Return Me._seal End Get Set Me._seal = Value End Set End Property Public Property ContainerIdentificationNumber() As String Get Return Me._containerIdentificationNumber End Get Set Me._containerIdentificationNumber = Value End Set End Property Public Property GoodsReference() As List(Of String) Get Return Me._goodsReference End Get Set Me._goodsReference = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransportEquipmentMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize TransportEquipmentMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes TransportEquipmentMRType object ''' ''' string to deserialize ''' Output TransportEquipmentMRType 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 TransportEquipmentMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransportEquipmentMRType) 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 TransportEquipmentMRType) 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 TransportEquipmentMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransportEquipmentMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As TransportEquipmentMRType Return CType(SerializerXml.Deserialize(s), TransportEquipmentMRType) End Function #End Region ''' ''' Serializes current TransportEquipmentMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an TransportEquipmentMRType object ''' ''' File to load and deserialize ''' Output TransportEquipmentMRType 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 TransportEquipmentMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransportEquipmentMRType) 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 TransportEquipmentMRType) 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 TransportEquipmentMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class CarrierMRType #Region "Private fields" Private _identificationNumber As String Private _subsidiaryNumber As String Private _contactPerson As ContactPersonMRType Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._contactPerson = New ContactPersonMRType() End Sub Public Property IdentificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = Value End Set End Property Public Property SubsidiaryNumber() As String Get Return Me._subsidiaryNumber End Get Set Me._subsidiaryNumber = Value End Set End Property Public Property ContactPerson() As ContactPersonMRType Get Return Me._contactPerson End Get Set Me._contactPerson = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CarrierMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize CarrierMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes CarrierMRType object ''' ''' string to deserialize ''' Output CarrierMRType 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 CarrierMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CarrierMRType) 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 CarrierMRType) 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 CarrierMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CarrierMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As CarrierMRType Return CType(SerializerXml.Deserialize(s), CarrierMRType) End Function #End Region ''' ''' Serializes current CarrierMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an CarrierMRType object ''' ''' File to load and deserialize ''' Output CarrierMRType 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 CarrierMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CarrierMRType) 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 CarrierMRType) 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 CarrierMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class RepresentativeMRType #Region "Private fields" Private _identificationNumber As String Private _name As String Private _streetAndNumber As String Private _city As String Private _postcode As String Private _country As String Private _contactPerson As ContactPersonMRType Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._contactPerson = New ContactPersonMRType() End Sub Public Property IdentificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = Value End Set End Property Public Property Name() As String Get Return Me._name End Get Set Me._name = Value End Set End Property Public Property StreetAndNumber() As String Get Return Me._streetAndNumber End Get Set Me._streetAndNumber = Value End Set End Property Public Property City() As String Get Return Me._city End Get Set Me._city = Value End Set End Property Public Property Postcode() As String Get Return Me._postcode End Get Set Me._postcode = Value End Set End Property Public Property Country() As String Get Return Me._country End Get Set Me._country = Value End Set End Property Public Property ContactPerson() As ContactPersonMRType Get Return Me._contactPerson End Get Set Me._contactPerson = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(RepresentativeMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize RepresentativeMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes RepresentativeMRType object ''' ''' string to deserialize ''' Output RepresentativeMRType 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 RepresentativeMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, RepresentativeMRType) 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 RepresentativeMRType) 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 RepresentativeMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), RepresentativeMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As RepresentativeMRType Return CType(SerializerXml.Deserialize(s), RepresentativeMRType) End Function #End Region ''' ''' Serializes current RepresentativeMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an RepresentativeMRType object ''' ''' File to load and deserialize ''' Output RepresentativeMRType 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 RepresentativeMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, RepresentativeMRType) 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 RepresentativeMRType) 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 RepresentativeMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class HolderOfTheTransitProcedureMRType #Region "Private fields" Private _identificationNumber As String Private _tIRHolderIdentificationNumber As String Private _name As String Private _streetAndNumber As String Private _city As String Private _postcode As String Private _country As String Private _contactPerson As ContactPersonMRType Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._contactPerson = New ContactPersonMRType() End Sub Public Property IdentificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = Value End Set End Property Public Property TIRHolderIdentificationNumber() As String Get Return Me._tIRHolderIdentificationNumber End Get Set Me._tIRHolderIdentificationNumber = Value End Set End Property Public Property Name() As String Get Return Me._name End Get Set Me._name = Value End Set End Property Public Property StreetAndNumber() As String Get Return Me._streetAndNumber End Get Set Me._streetAndNumber = Value End Set End Property Public Property City() As String Get Return Me._city End Get Set Me._city = Value End Set End Property Public Property Postcode() As String Get Return Me._postcode End Get Set Me._postcode = Value End Set End Property Public Property Country() As String Get Return Me._country End Get Set Me._country = Value End Set End Property Public Property ContactPerson() As ContactPersonMRType Get Return Me._contactPerson End Get Set Me._contactPerson = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(HolderOfTheTransitProcedureMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize HolderOfTheTransitProcedureMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes HolderOfTheTransitProcedureMRType object ''' ''' string to deserialize ''' Output HolderOfTheTransitProcedureMRType 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 HolderOfTheTransitProcedureMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, HolderOfTheTransitProcedureMRType) 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 HolderOfTheTransitProcedureMRType) 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 HolderOfTheTransitProcedureMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HolderOfTheTransitProcedureMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As HolderOfTheTransitProcedureMRType Return CType(SerializerXml.Deserialize(s), HolderOfTheTransitProcedureMRType) End Function #End Region ''' ''' Serializes current HolderOfTheTransitProcedureMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an HolderOfTheTransitProcedureMRType object ''' ''' File to load and deserialize ''' Output HolderOfTheTransitProcedureMRType 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 HolderOfTheTransitProcedureMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, HolderOfTheTransitProcedureMRType) 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 HolderOfTheTransitProcedureMRType) 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 HolderOfTheTransitProcedureMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class CustomsOfficeOfTransitDeclaredMRType #Region "Private fields" Private _referenceNumber As String Private _arrivalDateAndTimeEstimated As Date Private Shared _serializerXml As XmlSerializer #End Region Public Property ReferenceNumber() As String Get Return Me._referenceNumber End Get Set Me._referenceNumber = Value End Set End Property Public Property ArrivalDateAndTimeEstimated() As Date Get Return Me._arrivalDateAndTimeEstimated End Get Set Me._arrivalDateAndTimeEstimated = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CustomsOfficeOfTransitDeclaredMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize CustomsOfficeOfTransitDeclaredMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes CustomsOfficeOfTransitDeclaredMRType object ''' ''' string to deserialize ''' Output CustomsOfficeOfTransitDeclaredMRType 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 CustomsOfficeOfTransitDeclaredMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CustomsOfficeOfTransitDeclaredMRType) 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 CustomsOfficeOfTransitDeclaredMRType) 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 CustomsOfficeOfTransitDeclaredMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CustomsOfficeOfTransitDeclaredMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As CustomsOfficeOfTransitDeclaredMRType Return CType(SerializerXml.Deserialize(s), CustomsOfficeOfTransitDeclaredMRType) End Function #End Region ''' ''' Serializes current CustomsOfficeOfTransitDeclaredMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an CustomsOfficeOfTransitDeclaredMRType object ''' ''' File to load and deserialize ''' Output CustomsOfficeOfTransitDeclaredMRType 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 CustomsOfficeOfTransitDeclaredMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CustomsOfficeOfTransitDeclaredMRType) 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 CustomsOfficeOfTransitDeclaredMRType) 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 CustomsOfficeOfTransitDeclaredMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class DepartureTransportMeansMRType #Region "Private fields" Private _nationality As String Private _typeOfIdentification As String Private _identificationNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Nationality() As String Get Return Me._nationality End Get Set Me._nationality = Value End Set End Property Public Property TypeOfIdentification() As String Get Return Me._typeOfIdentification End Get Set Me._typeOfIdentification = Value End Set End Property Public Property IdentificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(DepartureTransportMeansMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize DepartureTransportMeansMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes DepartureTransportMeansMRType object ''' ''' string to deserialize ''' Output DepartureTransportMeansMRType 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 DepartureTransportMeansMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DepartureTransportMeansMRType) 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 DepartureTransportMeansMRType) 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 DepartureTransportMeansMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), DepartureTransportMeansMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As DepartureTransportMeansMRType Return CType(SerializerXml.Deserialize(s), DepartureTransportMeansMRType) End Function #End Region ''' ''' Serializes current DepartureTransportMeansMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DepartureTransportMeansMRType object ''' ''' File to load and deserialize ''' Output DepartureTransportMeansMRType 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 DepartureTransportMeansMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DepartureTransportMeansMRType) 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 DepartureTransportMeansMRType) 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 DepartureTransportMeansMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class PlaceOfLoadingMRType #Region "Private fields" Private _location As String Private _country As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Location() As String Get Return Me._location End Get Set Me._location = Value End Set End Property Public Property Country() As String Get Return Me._country End Get Set Me._country = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PlaceOfLoadingMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize PlaceOfLoadingMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes PlaceOfLoadingMRType object ''' ''' string to deserialize ''' Output PlaceOfLoadingMRType 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 PlaceOfLoadingMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PlaceOfLoadingMRType) 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 PlaceOfLoadingMRType) 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 PlaceOfLoadingMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PlaceOfLoadingMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As PlaceOfLoadingMRType Return CType(SerializerXml.Deserialize(s), PlaceOfLoadingMRType) End Function #End Region ''' ''' Serializes current PlaceOfLoadingMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an PlaceOfLoadingMRType object ''' ''' File to load and deserialize ''' Output PlaceOfLoadingMRType 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 PlaceOfLoadingMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PlaceOfLoadingMRType) 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 PlaceOfLoadingMRType) 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 PlaceOfLoadingMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class ActiveBorderTransportMeansMRType #Region "Private fields" Private _nationality As String Private _typeOfIdentification As String Private _identificationNumber As String Private _conveyanceReferenceNumber As String Private _customsOfficeAtBorderDeclared As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Nationality() As String Get Return Me._nationality End Get Set Me._nationality = Value End Set End Property Public Property TypeOfIdentification() As String Get Return Me._typeOfIdentification End Get Set Me._typeOfIdentification = Value End Set End Property Public Property IdentificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = Value End Set End Property Public Property ConveyanceReferenceNumber() As String Get Return Me._conveyanceReferenceNumber End Get Set Me._conveyanceReferenceNumber = Value End Set End Property Public Property CustomsOfficeAtBorderDeclared() As String Get Return Me._customsOfficeAtBorderDeclared End Get Set Me._customsOfficeAtBorderDeclared = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ActiveBorderTransportMeansMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ActiveBorderTransportMeansMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes ActiveBorderTransportMeansMRType object ''' ''' string to deserialize ''' Output ActiveBorderTransportMeansMRType 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 ActiveBorderTransportMeansMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ActiveBorderTransportMeansMRType) 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 ActiveBorderTransportMeansMRType) 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 ActiveBorderTransportMeansMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ActiveBorderTransportMeansMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As ActiveBorderTransportMeansMRType Return CType(SerializerXml.Deserialize(s), ActiveBorderTransportMeansMRType) End Function #End Region ''' ''' Serializes current ActiveBorderTransportMeansMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an ActiveBorderTransportMeansMRType object ''' ''' File to load and deserialize ''' Output ActiveBorderTransportMeansMRType 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 ActiveBorderTransportMeansMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ActiveBorderTransportMeansMRType) 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 ActiveBorderTransportMeansMRType) 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 ActiveBorderTransportMeansMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class GuaranteeReferenceMRType #Region "Private fields" Private _gRN As String Private _amountToBeCovered As Decimal Private _currency As String Private Shared _serializerXml As XmlSerializer #End Region Public Property GRN() As String Get Return Me._gRN End Get Set Me._gRN = Value End Set End Property Public Property AmountToBeCovered() As Decimal Get Return Me._amountToBeCovered End Get Set Me._amountToBeCovered = Value End Set End Property Public Property Currency() As String Get Return Me._currency End Get Set Me._currency = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(GuaranteeReferenceMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize GuaranteeReferenceMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes GuaranteeReferenceMRType object ''' ''' string to deserialize ''' Output GuaranteeReferenceMRType 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 GuaranteeReferenceMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GuaranteeReferenceMRType) 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 GuaranteeReferenceMRType) 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 GuaranteeReferenceMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), GuaranteeReferenceMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As GuaranteeReferenceMRType Return CType(SerializerXml.Deserialize(s), GuaranteeReferenceMRType) End Function #End Region ''' ''' Serializes current GuaranteeReferenceMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an GuaranteeReferenceMRType object ''' ''' File to load and deserialize ''' Output GuaranteeReferenceMRType 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 GuaranteeReferenceMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GuaranteeReferenceMRType) 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 GuaranteeReferenceMRType) 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 GuaranteeReferenceMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class GuaranteeMRType #Region "Private fields" Private _guaranteeType As String Private _otherGuaranteeReference As String Private _guaranteeReference As List(Of GuaranteeReferenceMRType) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._guaranteeReference = New List(Of GuaranteeReferenceMRType)() End Sub Public Property GuaranteeType() As String Get Return Me._guaranteeType End Get Set Me._guaranteeType = Value End Set End Property Public Property OtherGuaranteeReference() As String Get Return Me._otherGuaranteeReference End Get Set Me._otherGuaranteeReference = Value End Set End Property Public Property GuaranteeReference() As List(Of GuaranteeReferenceMRType) Get Return Me._guaranteeReference End Get Set Me._guaranteeReference = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(GuaranteeMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize GuaranteeMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes GuaranteeMRType object ''' ''' string to deserialize ''' Output GuaranteeMRType 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 GuaranteeMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GuaranteeMRType) 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 GuaranteeMRType) 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 GuaranteeMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), GuaranteeMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As GuaranteeMRType Return CType(SerializerXml.Deserialize(s), GuaranteeMRType) End Function #End Region ''' ''' Serializes current GuaranteeMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an GuaranteeMRType object ''' ''' File to load and deserialize ''' Output GuaranteeMRType 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 GuaranteeMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GuaranteeMRType) 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 GuaranteeMRType) 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 GuaranteeMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class TransitOperationMRType #Region "Private fields" Private _mRN As String Private _customsOfficeOfDeparture As String Private _declarationAcceptanceDateAndTime As Date Private _releaseDateAndTime As Date Private _limitDate As Date Private _guarantee As List(Of GuaranteeMRType) Private _customsOfficeOfDestinationDeclared As String Private _nameOfAccompanyingDocument As String Private _security As String Private _referenceNumberUCR As String Private _activeBorderTransportMeans As List(Of ActiveBorderTransportMeansMRType) Private _specificCircumstanceIndicator As String Private _placeOfLoading As PlaceOfLoadingMRType Private _placeOfUnloading As PlaceOfLoadingMRType Private _transportCharges As String Private _declarationType As String Private _transitDeclarationType As String Private _tIRCarnetNumber As String Private _reducedDatasetIndicator As String Private _bindingItinerary As String Private _countryOfDispatch As String Private _countryOfDestination As String Private _grossMass As Decimal Private _containerIndicator As String Private _inlandModeOfTransport As String Private _modeOfTransportAtTheBorder As String Private _departureTransportMeans As List(Of DepartureTransportMeansMRType) Private _customsOfficeOfTransitDeclared As List(Of CustomsOfficeOfTransitDeclaredMRType) Private _customsOfficeOfExitForTransitDeclared As List(Of String) Private _countryOfRoutingOfConsignment As List(Of String) Private _consignor As AddressMRType Private _consignee As AddressMRType Private _holderOfTheTransitProcedure As HolderOfTheTransitProcedureMRType Private _representative As RepresentativeMRType Private _carrier As CarrierMRType Private _additionalSupplyChainActor As List(Of AdditionalSupplyChainActorMRType) Private _transportEquipment As List(Of TransportEquipmentMRType) Private _authorisation As List(Of AuthorisationMRType) Private _locationOfGoods As LocationOfGoodsMRType Private _previousDocument As List(Of PreviousDocumentMRType) Private _supportingDocument As List(Of SupportingDocumentMRType) Private _transportDocument As List(Of TransportDocumentMRType) Private _additionalReference As List(Of AdditionalReferenceMRType) Private _additionalInformation As List(Of AdditionalInformationMRType) Private _applicationInternalData As ApplicationInternalDataType Private _houseConsignment As List(Of HouseConsignmentMRType) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._houseConsignment = New List(Of HouseConsignmentMRType)() Me._applicationInternalData = New ApplicationInternalDataType() Me._additionalInformation = New List(Of AdditionalInformationMRType)() Me._additionalReference = New List(Of AdditionalReferenceMRType)() Me._transportDocument = New List(Of TransportDocumentMRType)() Me._supportingDocument = New List(Of SupportingDocumentMRType)() Me._previousDocument = New List(Of PreviousDocumentMRType)() Me._locationOfGoods = New LocationOfGoodsMRType() Me._authorisation = New List(Of AuthorisationMRType)() Me._transportEquipment = New List(Of TransportEquipmentMRType)() Me._additionalSupplyChainActor = New List(Of AdditionalSupplyChainActorMRType)() Me._carrier = New CarrierMRType() Me._representative = New RepresentativeMRType() Me._holderOfTheTransitProcedure = New HolderOfTheTransitProcedureMRType() Me._consignee = New AddressMRType() Me._consignor = New AddressMRType() Me._countryOfRoutingOfConsignment = New List(Of String)() Me._customsOfficeOfExitForTransitDeclared = New List(Of String)() Me._customsOfficeOfTransitDeclared = New List(Of CustomsOfficeOfTransitDeclaredMRType)() Me._departureTransportMeans = New List(Of DepartureTransportMeansMRType)() Me._placeOfUnloading = New PlaceOfLoadingMRType() Me._placeOfLoading = New PlaceOfLoadingMRType() Me._activeBorderTransportMeans = New List(Of ActiveBorderTransportMeansMRType)() Me._guarantee = New List(Of GuaranteeMRType)() End Sub Public Property MRN() As String Get Return Me._mRN End Get Set Me._mRN = Value End Set End Property Public Property CustomsOfficeOfDeparture() As String Get Return Me._customsOfficeOfDeparture End Get Set Me._customsOfficeOfDeparture = Value End Set End Property Public Property DeclarationAcceptanceDateAndTime() As Date Get Return Me._declarationAcceptanceDateAndTime End Get Set Me._declarationAcceptanceDateAndTime = Value End Set End Property Public Property ReleaseDateAndTime() As Date Get Return Me._releaseDateAndTime End Get Set Me._releaseDateAndTime = Value End Set End Property Public Property LimitDate() As Date Get Return Me._limitDate End Get Set Me._limitDate = Value End Set End Property Public Property Guarantee() As List(Of GuaranteeMRType) Get Return Me._guarantee End Get Set Me._guarantee = Value End Set End Property Public Property CustomsOfficeOfDestinationDeclared() As String Get Return Me._customsOfficeOfDestinationDeclared End Get Set Me._customsOfficeOfDestinationDeclared = Value End Set End Property Public Property NameOfAccompanyingDocument() As String Get Return Me._nameOfAccompanyingDocument End Get Set Me._nameOfAccompanyingDocument = Value End Set End Property Public Property Security() As String Get Return Me._security End Get Set Me._security = Value End Set End Property Public Property ReferenceNumberUCR() As String Get Return Me._referenceNumberUCR End Get Set Me._referenceNumberUCR = Value End Set End Property Public Property ActiveBorderTransportMeans() As List(Of ActiveBorderTransportMeansMRType) Get Return Me._activeBorderTransportMeans End Get Set Me._activeBorderTransportMeans = Value End Set End Property Public Property SpecificCircumstanceIndicator() As String Get Return Me._specificCircumstanceIndicator End Get Set Me._specificCircumstanceIndicator = Value End Set End Property Public Property PlaceOfLoading() As PlaceOfLoadingMRType Get Return Me._placeOfLoading End Get Set Me._placeOfLoading = Value End Set End Property Public Property PlaceOfUnloading() As PlaceOfLoadingMRType Get Return Me._placeOfUnloading End Get Set Me._placeOfUnloading = Value End Set End Property Public Property TransportCharges() As String Get Return Me._transportCharges End Get Set Me._transportCharges = Value End Set End Property Public Property DeclarationType() As String Get Return Me._declarationType End Get Set Me._declarationType = Value End Set End Property Public Property TransitDeclarationType() As String Get Return Me._transitDeclarationType End Get Set Me._transitDeclarationType = Value End Set End Property Public Property TIRCarnetNumber() As String Get Return Me._tIRCarnetNumber End Get Set Me._tIRCarnetNumber = Value End Set End Property Public Property ReducedDatasetIndicator() As String Get Return Me._reducedDatasetIndicator End Get Set Me._reducedDatasetIndicator = Value End Set End Property Public Property BindingItinerary() As String Get Return Me._bindingItinerary End Get Set Me._bindingItinerary = Value End Set End Property Public Property CountryOfDispatch() As String Get Return Me._countryOfDispatch End Get Set Me._countryOfDispatch = Value End Set End Property Public Property CountryOfDestination() As String Get Return Me._countryOfDestination End Get Set Me._countryOfDestination = Value End Set End Property Public Property GrossMass() As Decimal Get Return Me._grossMass End Get Set Me._grossMass = Value End Set End Property Public Property ContainerIndicator() As String Get Return Me._containerIndicator End Get Set Me._containerIndicator = Value End Set End Property Public Property InlandModeOfTransport() As String Get Return Me._inlandModeOfTransport End Get Set Me._inlandModeOfTransport = Value End Set End Property Public Property ModeOfTransportAtTheBorder() As String Get Return Me._modeOfTransportAtTheBorder End Get Set Me._modeOfTransportAtTheBorder = Value End Set End Property Public Property DepartureTransportMeans() As List(Of DepartureTransportMeansMRType) Get Return Me._departureTransportMeans End Get Set Me._departureTransportMeans = Value End Set End Property Public Property CustomsOfficeOfTransitDeclared() As List(Of CustomsOfficeOfTransitDeclaredMRType) Get Return Me._customsOfficeOfTransitDeclared End Get Set Me._customsOfficeOfTransitDeclared = Value End Set End Property Public Property CustomsOfficeOfExitForTransitDeclared() As List(Of String) Get Return Me._customsOfficeOfExitForTransitDeclared End Get Set Me._customsOfficeOfExitForTransitDeclared = Value End Set End Property Public Property CountryOfRoutingOfConsignment() As List(Of String) Get Return Me._countryOfRoutingOfConsignment End Get Set Me._countryOfRoutingOfConsignment = Value End Set End Property Public Property Consignor() As AddressMRType Get Return Me._consignor End Get Set Me._consignor = Value End Set End Property Public Property Consignee() As AddressMRType Get Return Me._consignee End Get Set Me._consignee = Value End Set End Property Public Property HolderOfTheTransitProcedure() As HolderOfTheTransitProcedureMRType Get Return Me._holderOfTheTransitProcedure End Get Set Me._holderOfTheTransitProcedure = Value End Set End Property Public Property Representative() As RepresentativeMRType Get Return Me._representative End Get Set Me._representative = Value End Set End Property Public Property Carrier() As CarrierMRType Get Return Me._carrier End Get Set Me._carrier = Value End Set End Property Public Property AdditionalSupplyChainActor() As List(Of AdditionalSupplyChainActorMRType) Get Return Me._additionalSupplyChainActor End Get Set Me._additionalSupplyChainActor = Value End Set End Property Public Property TransportEquipment() As List(Of TransportEquipmentMRType) Get Return Me._transportEquipment End Get Set Me._transportEquipment = Value End Set End Property Public Property Authorisation() As List(Of AuthorisationMRType) Get Return Me._authorisation End Get Set Me._authorisation = Value End Set End Property Public Property LocationOfGoods() As LocationOfGoodsMRType Get Return Me._locationOfGoods End Get Set Me._locationOfGoods = Value End Set End Property Public Property PreviousDocument() As List(Of PreviousDocumentMRType) Get Return Me._previousDocument End Get Set Me._previousDocument = Value End Set End Property Public Property SupportingDocument() As List(Of SupportingDocumentMRType) Get Return Me._supportingDocument End Get Set Me._supportingDocument = Value End Set End Property Public Property TransportDocument() As List(Of TransportDocumentMRType) Get Return Me._transportDocument End Get Set Me._transportDocument = Value End Set End Property Public Property AdditionalReference() As List(Of AdditionalReferenceMRType) Get Return Me._additionalReference End Get Set Me._additionalReference = Value End Set End Property Public Property AdditionalInformation() As List(Of AdditionalInformationMRType) Get Return Me._additionalInformation End Get Set Me._additionalInformation = Value End Set End Property Public Property ApplicationInternalData() As ApplicationInternalDataType Get Return Me._applicationInternalData End Get Set Me._applicationInternalData = Value End Set End Property Public Property HouseConsignment() As List(Of HouseConsignmentMRType) Get Return Me._houseConsignment End Get Set Me._houseConsignment = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransitOperationMRType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize TransitOperationMRType object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes TransitOperationMRType object ''' ''' string to deserialize ''' Output TransitOperationMRType 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 TransitOperationMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransitOperationMRType) 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 TransitOperationMRType) 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 TransitOperationMRType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransitOperationMRType) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As TransitOperationMRType Return CType(SerializerXml.Deserialize(s), TransitOperationMRType) End Function #End Region ''' ''' Serializes current TransitOperationMRType object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an TransitOperationMRType object ''' ''' File to load and deserialize ''' Output TransitOperationMRType 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 TransitOperationMRType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransitOperationMRType) 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 TransitOperationMRType) 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 TransitOperationMRType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class PositionAVUVMRTyp #Region "Private fields" Private _satznummer As String Private _kzZugangATLAS As String Private _registriernummer As String Private _positionsnummer As String Private _warenbezogeneAngaben As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Satznummer() As String Get Return Me._satznummer End Get Set Me._satznummer = Value End Set End Property Public Property KzZugangATLAS() As String Get Return Me._kzZugangATLAS End Get Set Me._kzZugangATLAS = Value End Set End Property Public Property Registriernummer() As String Get Return Me._registriernummer End Get Set Me._registriernummer = Value End Set End Property Public Property Positionsnummer() As String Get Return Me._positionsnummer End Get Set Me._positionsnummer = Value End Set End Property Public Property WarenbezogeneAngaben() As String Get Return Me._warenbezogeneAngaben End Get Set Me._warenbezogeneAngaben = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PositionAVUVMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize PositionAVUVMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes PositionAVUVMRTyp object ''' ''' string to deserialize ''' Output PositionAVUVMRTyp 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 PositionAVUVMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PositionAVUVMRTyp) 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 PositionAVUVMRTyp) 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 PositionAVUVMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PositionAVUVMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As PositionAVUVMRTyp Return CType(SerializerXml.Deserialize(s), PositionAVUVMRTyp) End Function #End Region ''' ''' Serializes current PositionAVUVMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an PositionAVUVMRTyp object ''' ''' File to load and deserialize ''' Output PositionAVUVMRTyp 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 PositionAVUVMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PositionAVUVMRTyp) 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 PositionAVUVMRTyp) 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 PositionAVUVMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class BeendigungAVUVMRTyp #Region "Private fields" Private _kennzeichenAbgleichErfolgt As String Private _bewilligungsnummer As String Private _kzVereinfBewillAntrgAV As String Private _deutschesUeHZAbeiAV As String Private _positionAVUV As List(Of PositionAVUVMRTyp) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._positionAVUV = New List(Of PositionAVUVMRTyp)() End Sub Public Property KennzeichenAbgleichErfolgt() As String Get Return Me._kennzeichenAbgleichErfolgt End Get Set Me._kennzeichenAbgleichErfolgt = Value End Set End Property Public Property Bewilligungsnummer() As String Get Return Me._bewilligungsnummer End Get Set Me._bewilligungsnummer = Value End Set End Property Public Property KzVereinfBewillAntrgAV() As String Get Return Me._kzVereinfBewillAntrgAV End Get Set Me._kzVereinfBewillAntrgAV = Value End Set End Property Public Property DeutschesUeHZAbeiAV() As String Get Return Me._deutschesUeHZAbeiAV End Get Set Me._deutschesUeHZAbeiAV = Value End Set End Property Public Property PositionAVUV() As List(Of PositionAVUVMRTyp) Get Return Me._positionAVUV End Get Set Me._positionAVUV = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(BeendigungAVUVMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize BeendigungAVUVMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes BeendigungAVUVMRTyp object ''' ''' string to deserialize ''' Output BeendigungAVUVMRTyp 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 BeendigungAVUVMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, BeendigungAVUVMRTyp) 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 BeendigungAVUVMRTyp) 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 BeendigungAVUVMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), BeendigungAVUVMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As BeendigungAVUVMRTyp Return CType(SerializerXml.Deserialize(s), BeendigungAVUVMRTyp) End Function #End Region ''' ''' Serializes current BeendigungAVUVMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an BeendigungAVUVMRTyp object ''' ''' File to load and deserialize ''' Output BeendigungAVUVMRTyp 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 BeendigungAVUVMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, BeendigungAVUVMRTyp) 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 BeendigungAVUVMRTyp) 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 BeendigungAVUVMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class HandelsmengeMRTyp #Region "Private fields" Private _wert As Decimal Private _masseinheit As String Private _qualifikator As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Wert() As Decimal Get Return Me._wert End Get Set Me._wert = Value End Set End Property Public Property Masseinheit() As String Get Return Me._masseinheit End Get Set Me._masseinheit = Value End Set End Property Public Property Qualifikator() As String Get Return Me._qualifikator End Get Set Me._qualifikator = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(HandelsmengeMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize HandelsmengeMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes HandelsmengeMRTyp object ''' ''' string to deserialize ''' Output HandelsmengeMRTyp 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 HandelsmengeMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, HandelsmengeMRTyp) 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 HandelsmengeMRTyp) 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 HandelsmengeMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HandelsmengeMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As HandelsmengeMRTyp Return CType(SerializerXml.Deserialize(s), HandelsmengeMRTyp) End Function #End Region ''' ''' Serializes current HandelsmengeMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an HandelsmengeMRTyp object ''' ''' File to load and deserialize ''' Output HandelsmengeMRTyp 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 HandelsmengeMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, HandelsmengeMRTyp) 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 HandelsmengeMRTyp) 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 HandelsmengeMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class AbgangsmengeMRTyp #Region "Private fields" Private _wert As Decimal Private _masseinheit As String Private _qualifikator As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Wert() As Decimal Get Return Me._wert End Get Set Me._wert = Value End Set End Property Public Property Masseinheit() As String Get Return Me._masseinheit End Get Set Me._masseinheit = Value End Set End Property Public Property Qualifikator() As String Get Return Me._qualifikator End Get Set Me._qualifikator = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AbgangsmengeMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AbgangsmengeMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes AbgangsmengeMRTyp object ''' ''' string to deserialize ''' Output AbgangsmengeMRTyp 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 AbgangsmengeMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AbgangsmengeMRTyp) 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 AbgangsmengeMRTyp) 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 AbgangsmengeMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AbgangsmengeMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As AbgangsmengeMRTyp Return CType(SerializerXml.Deserialize(s), AbgangsmengeMRTyp) End Function #End Region ''' ''' Serializes current AbgangsmengeMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an AbgangsmengeMRTyp object ''' ''' File to load and deserialize ''' Output AbgangsmengeMRTyp 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 AbgangsmengeMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AbgangsmengeMRTyp) 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 AbgangsmengeMRTyp) 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 AbgangsmengeMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class PositionZLMRTyp #Region "Private fields" Private _satznummer As String Private _warennummer As String Private _kzZugangATLAS As String Private _kzUeblicheBehandlung As String Private _registriernummer As String Private _positionsnummer As String Private _zusatz As String Private _abgangsmenge As AbgangsmengeMRTyp Private _handelsmenge As HandelsmengeMRTyp Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._handelsmenge = New HandelsmengeMRTyp() Me._abgangsmenge = New AbgangsmengeMRTyp() End Sub Public Property Satznummer() As String Get Return Me._satznummer End Get Set Me._satznummer = Value End Set End Property Public Property Warennummer() As String Get Return Me._warennummer End Get Set Me._warennummer = Value End Set End Property Public Property KzZugangATLAS() As String Get Return Me._kzZugangATLAS End Get Set Me._kzZugangATLAS = Value End Set End Property Public Property KzUeblicheBehandlung() As String Get Return Me._kzUeblicheBehandlung End Get Set Me._kzUeblicheBehandlung = Value End Set End Property Public Property Registriernummer() As String Get Return Me._registriernummer End Get Set Me._registriernummer = Value End Set End Property Public Property Positionsnummer() As String Get Return Me._positionsnummer End Get Set Me._positionsnummer = Value End Set End Property Public Property Zusatz() As String Get Return Me._zusatz End Get Set Me._zusatz = Value End Set End Property Public Property Abgangsmenge() As AbgangsmengeMRTyp Get Return Me._abgangsmenge End Get Set Me._abgangsmenge = Value End Set End Property Public Property Handelsmenge() As HandelsmengeMRTyp Get Return Me._handelsmenge End Get Set Me._handelsmenge = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PositionZLMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize PositionZLMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes PositionZLMRTyp object ''' ''' string to deserialize ''' Output PositionZLMRTyp 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 PositionZLMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PositionZLMRTyp) 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 PositionZLMRTyp) 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 PositionZLMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PositionZLMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As PositionZLMRTyp Return CType(SerializerXml.Deserialize(s), PositionZLMRTyp) End Function #End Region ''' ''' Serializes current PositionZLMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an PositionZLMRTyp object ''' ''' File to load and deserialize ''' Output PositionZLMRTyp 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 PositionZLMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PositionZLMRTyp) 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 PositionZLMRTyp) 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 PositionZLMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class BeendigungZLMRTyp #Region "Private fields" Private _bezugsnummer As String Private _kennzeichenAbgleichErfolgt As String Private _bewilligungsnummer As String Private _positionZL As List(Of PositionZLMRTyp) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._positionZL = New List(Of PositionZLMRTyp)() End Sub Public Property Bezugsnummer() As String Get Return Me._bezugsnummer End Get Set Me._bezugsnummer = Value End Set End Property Public Property KennzeichenAbgleichErfolgt() As String Get Return Me._kennzeichenAbgleichErfolgt End Get Set Me._kennzeichenAbgleichErfolgt = Value End Set End Property Public Property Bewilligungsnummer() As String Get Return Me._bewilligungsnummer End Get Set Me._bewilligungsnummer = Value End Set End Property Public Property PositionZL() As List(Of PositionZLMRTyp) Get Return Me._positionZL End Get Set Me._positionZL = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(BeendigungZLMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize BeendigungZLMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes BeendigungZLMRTyp object ''' ''' string to deserialize ''' Output BeendigungZLMRTyp 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 BeendigungZLMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, BeendigungZLMRTyp) 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 BeendigungZLMRTyp) 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 BeendigungZLMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), BeendigungZLMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As BeendigungZLMRTyp Return CType(SerializerXml.Deserialize(s), BeendigungZLMRTyp) End Function #End Region ''' ''' Serializes current BeendigungZLMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an BeendigungZLMRTyp object ''' ''' File to load and deserialize ''' Output BeendigungZLMRTyp 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 BeendigungZLMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, BeendigungZLMRTyp) 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 BeendigungZLMRTyp) 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 BeendigungZLMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class PositionSumAMRTyp #Region "Private fields" Private _satznummer As String Private _stueckzahl As String Private _registriernummer As String Private _positionsnummer As String Private _verwahrerEORI As String Private _spOArt As String Private _spONummer As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Satznummer() As String Get Return Me._satznummer End Get Set Me._satznummer = Value End Set End Property Public Property Stueckzahl() As String Get Return Me._stueckzahl End Get Set Me._stueckzahl = Value End Set End Property Public Property Registriernummer() As String Get Return Me._registriernummer End Get Set Me._registriernummer = Value End Set End Property Public Property Positionsnummer() As String Get Return Me._positionsnummer End Get Set Me._positionsnummer = Value End Set End Property Public Property VerwahrerEORI() As String Get Return Me._verwahrerEORI End Get Set Me._verwahrerEORI = Value End Set End Property Public Property SpOArt() As String Get Return Me._spOArt End Get Set Me._spOArt = Value End Set End Property Public Property SpONummer() As String Get Return Me._spONummer End Get Set Me._spONummer = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PositionSumAMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize PositionSumAMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes PositionSumAMRTyp object ''' ''' string to deserialize ''' Output PositionSumAMRTyp 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 PositionSumAMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PositionSumAMRTyp) 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 PositionSumAMRTyp) 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 PositionSumAMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PositionSumAMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As PositionSumAMRTyp Return CType(SerializerXml.Deserialize(s), PositionSumAMRTyp) End Function #End Region ''' ''' Serializes current PositionSumAMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an PositionSumAMRTyp object ''' ''' File to load and deserialize ''' Output PositionSumAMRTyp 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 PositionSumAMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PositionSumAMRTyp) 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 PositionSumAMRTyp) 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 PositionSumAMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class BeendigungSumAMRTyp #Region "Private fields" Private _kennzeichenAbgleichErfolgt As String Private _artIdentifikation As String Private _positionSumA As List(Of PositionSumAMRTyp) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._positionSumA = New List(Of PositionSumAMRTyp)() End Sub Public Property KennzeichenAbgleichErfolgt() As String Get Return Me._kennzeichenAbgleichErfolgt End Get Set Me._kennzeichenAbgleichErfolgt = Value End Set End Property Public Property ArtIdentifikation() As String Get Return Me._artIdentifikation End Get Set Me._artIdentifikation = Value End Set End Property Public Property PositionSumA() As List(Of PositionSumAMRTyp) Get Return Me._positionSumA End Get Set Me._positionSumA = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(BeendigungSumAMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize BeendigungSumAMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes BeendigungSumAMRTyp object ''' ''' string to deserialize ''' Output BeendigungSumAMRTyp 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 BeendigungSumAMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, BeendigungSumAMRTyp) 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 BeendigungSumAMRTyp) 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 BeendigungSumAMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), BeendigungSumAMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As BeendigungSumAMRTyp Return CType(SerializerXml.Deserialize(s), BeendigungSumAMRTyp) End Function #End Region ''' ''' Serializes current BeendigungSumAMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an BeendigungSumAMRTyp object ''' ''' File to load and deserialize ''' Output BeendigungSumAMRTyp 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 BeendigungSumAMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, BeendigungSumAMRTyp) 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 BeendigungSumAMRTyp) 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 BeendigungSumAMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class BesondereVermerkeMRTyp #Region "Private fields" Private _exportBeschraenkung As String Private _exportAbgaben As String Private _export As String Private _exportAusEU As String Private _exportAusLand As String Private _kz10600 As String Private Shared _serializerXml As XmlSerializer #End Region Public Property ExportBeschraenkung() As String Get Return Me._exportBeschraenkung End Get Set Me._exportBeschraenkung = Value End Set End Property Public Property ExportAbgaben() As String Get Return Me._exportAbgaben End Get Set Me._exportAbgaben = Value End Set End Property Public Property Export() As String Get Return Me._export End Get Set Me._export = Value End Set End Property Public Property ExportAusEU() As String Get Return Me._exportAusEU End Get Set Me._exportAusEU = Value End Set End Property Public Property ExportAusLand() As String Get Return Me._exportAusLand End Get Set Me._exportAusLand = Value End Set End Property Public Property Kz10600() As String Get Return Me._kz10600 End Get Set Me._kz10600 = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(BesondereVermerkeMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize BesondereVermerkeMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes BesondereVermerkeMRTyp object ''' ''' string to deserialize ''' Output BesondereVermerkeMRTyp 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 BesondereVermerkeMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, BesondereVermerkeMRTyp) 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 BesondereVermerkeMRTyp) 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 BesondereVermerkeMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), BesondereVermerkeMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As BesondereVermerkeMRTyp Return CType(SerializerXml.Deserialize(s), BesondereVermerkeMRTyp) End Function #End Region ''' ''' Serializes current BesondereVermerkeMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an BesondereVermerkeMRTyp object ''' ''' File to load and deserialize ''' Output BesondereVermerkeMRTyp 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 BesondereVermerkeMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, BesondereVermerkeMRTyp) 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 BesondereVermerkeMRTyp) 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 BesondereVermerkeMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class VorgelegteUnterlBeschGenehmMRTyp #Region "Private fields" Private _typ As String Private _referenz As String Private _zusatz As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Typ() As String Get Return Me._typ End Get Set Me._typ = Value End Set End Property Public Property Referenz() As String Get Return Me._referenz End Get Set Me._referenz = Value End Set End Property Public Property Zusatz() As String Get Return Me._zusatz End Get Set Me._zusatz = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(VorgelegteUnterlBeschGenehmMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize VorgelegteUnterlBeschGenehmMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes VorgelegteUnterlBeschGenehmMRTyp object ''' ''' string to deserialize ''' Output VorgelegteUnterlBeschGenehmMRTyp 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 VorgelegteUnterlBeschGenehmMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, VorgelegteUnterlBeschGenehmMRTyp) 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 VorgelegteUnterlBeschGenehmMRTyp) 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 VorgelegteUnterlBeschGenehmMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), VorgelegteUnterlBeschGenehmMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As VorgelegteUnterlBeschGenehmMRTyp Return CType(SerializerXml.Deserialize(s), VorgelegteUnterlBeschGenehmMRTyp) End Function #End Region ''' ''' Serializes current VorgelegteUnterlBeschGenehmMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an VorgelegteUnterlBeschGenehmMRTyp object ''' ''' File to load and deserialize ''' Output VorgelegteUnterlBeschGenehmMRTyp 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 VorgelegteUnterlBeschGenehmMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, VorgelegteUnterlBeschGenehmMRTyp) 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 VorgelegteUnterlBeschGenehmMRTyp) 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 VorgelegteUnterlBeschGenehmMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class PackstueckMRTyp #Region "Private fields" Private _anzahl As String Private _verpackungsart As String Private _zeichenNummern As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Anzahl() As String Get Return Me._anzahl End Get Set Me._anzahl = Value End Set End Property Public Property Verpackungsart() As String Get Return Me._verpackungsart End Get Set Me._verpackungsart = Value End Set End Property Public Property ZeichenNummern() As String Get Return Me._zeichenNummern End Get Set Me._zeichenNummern = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PackstueckMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize PackstueckMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes PackstueckMRTyp object ''' ''' string to deserialize ''' Output PackstueckMRTyp 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 PackstueckMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PackstueckMRTyp) 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 PackstueckMRTyp) 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 PackstueckMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PackstueckMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As PackstueckMRTyp Return CType(SerializerXml.Deserialize(s), PackstueckMRTyp) End Function #End Region ''' ''' Serializes current PackstueckMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an PackstueckMRTyp object ''' ''' File to load and deserialize ''' Output PackstueckMRTyp 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 PackstueckMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PackstueckMRTyp) 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 PackstueckMRTyp) 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 PackstueckMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class VorpapierMRTyp #Region "Private fields" Private _referenz As String Private _zusatz As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Referenz() As String Get Return Me._referenz End Get Set Me._referenz = Value End Set End Property Public Property Zusatz() As String Get Return Me._zusatz End Get Set Me._zusatz = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(VorpapierMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize VorpapierMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes VorpapierMRTyp object ''' ''' string to deserialize ''' Output VorpapierMRTyp 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 VorpapierMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, VorpapierMRTyp) 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 VorpapierMRTyp) 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 VorpapierMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), VorpapierMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As VorpapierMRTyp Return CType(SerializerXml.Deserialize(s), VorpapierMRTyp) End Function #End Region ''' ''' Serializes current VorpapierMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an VorpapierMRTyp object ''' ''' File to load and deserialize ''' Output VorpapierMRTyp 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 VorpapierMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, VorpapierMRTyp) 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 VorpapierMRTyp) 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 VorpapierMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class WarenPositionUeberlassungsmeldungTyp #Region "Private fields" Private _positionsnummer As String Private _artAnmeldungPosition As String Private _versendungsAusfuhrlandPosition As String Private _bestimmungslandPosition As String Private _warennummer As String Private _kennnummerSendungPosition As String Private _befoerderungskostenZahlungsweisePosition As String Private _uNGefahrgutnummer As String Private _warenbezeichnung As String Private _rohmasse As Decimal Private _eigenmasse As Decimal Private _versenderPosition As AdresseMRTyp Private _versenderSumASicherheitPosition As AdresseMRTyp Private _empfaenger As AdresseMRTyp Private _empfaengerSumASicherheitPosition As AdresseMRTyp Private _vorpapiereTyp As String Private _vorpapier As List(Of VorpapierMRTyp) Private _packstuecke As List(Of PackstueckMRTyp) Private _containernummer As List(Of String) Private _vorgelegteUnterlagenBescheinigungenGenehmigungen As List(Of VorgelegteUnterlBeschGenehmMRTyp) Private _besondereVermerke As BesondereVermerkeMRTyp Private _beendigungSumA As BeendigungSumAMRTyp Private _beendigungZL As BeendigungZLMRTyp Private _beendigungAVUV As BeendigungAVUVMRTyp Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._beendigungAVUV = New BeendigungAVUVMRTyp() Me._beendigungZL = New BeendigungZLMRTyp() Me._beendigungSumA = New BeendigungSumAMRTyp() Me._besondereVermerke = New BesondereVermerkeMRTyp() Me._vorgelegteUnterlagenBescheinigungenGenehmigungen = New List(Of VorgelegteUnterlBeschGenehmMRTyp)() Me._containernummer = New List(Of String)() Me._packstuecke = New List(Of PackstueckMRTyp)() Me._vorpapier = New List(Of VorpapierMRTyp)() Me._empfaengerSumASicherheitPosition = New AdresseMRTyp() Me._empfaenger = New AdresseMRTyp() Me._versenderSumASicherheitPosition = New AdresseMRTyp() Me._versenderPosition = New AdresseMRTyp() End Sub Public Property Positionsnummer() As String Get Return Me._positionsnummer End Get Set Me._positionsnummer = Value End Set End Property Public Property ArtAnmeldungPosition() As String Get Return Me._artAnmeldungPosition End Get Set Me._artAnmeldungPosition = Value End Set End Property Public Property VersendungsAusfuhrlandPosition() As String Get Return Me._versendungsAusfuhrlandPosition End Get Set Me._versendungsAusfuhrlandPosition = Value End Set End Property Public Property BestimmungslandPosition() As String Get Return Me._bestimmungslandPosition End Get Set Me._bestimmungslandPosition = Value End Set End Property Public Property Warennummer() As String Get Return Me._warennummer End Get Set Me._warennummer = Value End Set End Property Public Property KennnummerSendungPosition() As String Get Return Me._kennnummerSendungPosition End Get Set Me._kennnummerSendungPosition = Value End Set End Property Public Property BefoerderungskostenZahlungsweisePosition() As String Get Return Me._befoerderungskostenZahlungsweisePosition End Get Set Me._befoerderungskostenZahlungsweisePosition = Value End Set End Property Public Property UNGefahrgutnummer() As String Get Return Me._uNGefahrgutnummer End Get Set Me._uNGefahrgutnummer = Value End Set End Property Public Property Warenbezeichnung() As String Get Return Me._warenbezeichnung End Get Set Me._warenbezeichnung = Value End Set End Property Public Property Rohmasse() As Decimal Get Return Me._rohmasse End Get Set Me._rohmasse = Value End Set End Property Public Property Eigenmasse() As Decimal Get Return Me._eigenmasse End Get Set Me._eigenmasse = Value End Set End Property Public Property VersenderPosition() As AdresseMRTyp Get Return Me._versenderPosition End Get Set Me._versenderPosition = Value End Set End Property Public Property VersenderSumASicherheitPosition() As AdresseMRTyp Get Return Me._versenderSumASicherheitPosition End Get Set Me._versenderSumASicherheitPosition = Value End Set End Property Public Property Empfaenger() As AdresseMRTyp Get Return Me._empfaenger End Get Set Me._empfaenger = Value End Set End Property Public Property EmpfaengerSumASicherheitPosition() As AdresseMRTyp Get Return Me._empfaengerSumASicherheitPosition End Get Set Me._empfaengerSumASicherheitPosition = Value End Set End Property Public Property VorpapiereTyp() As String Get Return Me._vorpapiereTyp End Get Set Me._vorpapiereTyp = Value End Set End Property Public Property Vorpapier() As List(Of VorpapierMRTyp) Get Return Me._vorpapier End Get Set Me._vorpapier = Value End Set End Property Public Property Packstuecke() As List(Of PackstueckMRTyp) Get Return Me._packstuecke End Get Set Me._packstuecke = Value End Set End Property Public Property Containernummer() As List(Of String) Get Return Me._containernummer End Get Set Me._containernummer = Value End Set End Property Public Property VorgelegteUnterlagenBescheinigungenGenehmigungen() As List(Of VorgelegteUnterlBeschGenehmMRTyp) Get Return Me._vorgelegteUnterlagenBescheinigungenGenehmigungen End Get Set Me._vorgelegteUnterlagenBescheinigungenGenehmigungen = Value End Set End Property Public Property BesondereVermerke() As BesondereVermerkeMRTyp Get Return Me._besondereVermerke End Get Set Me._besondereVermerke = Value End Set End Property Public Property BeendigungSumA() As BeendigungSumAMRTyp Get Return Me._beendigungSumA End Get Set Me._beendigungSumA = Value End Set End Property Public Property BeendigungZL() As BeendigungZLMRTyp Get Return Me._beendigungZL End Get Set Me._beendigungZL = Value End Set End Property Public Property BeendigungAVUV() As BeendigungAVUVMRTyp Get Return Me._beendigungAVUV End Get Set Me._beendigungAVUV = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(WarenPositionUeberlassungsmeldungTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize WarenPositionUeberlassungsmeldungTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes WarenPositionUeberlassungsmeldungTyp object ''' ''' string to deserialize ''' Output WarenPositionUeberlassungsmeldungTyp 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 WarenPositionUeberlassungsmeldungTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, WarenPositionUeberlassungsmeldungTyp) 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 WarenPositionUeberlassungsmeldungTyp) 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 WarenPositionUeberlassungsmeldungTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), WarenPositionUeberlassungsmeldungTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As WarenPositionUeberlassungsmeldungTyp Return CType(SerializerXml.Deserialize(s), WarenPositionUeberlassungsmeldungTyp) End Function #End Region ''' ''' Serializes current WarenPositionUeberlassungsmeldungTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an WarenPositionUeberlassungsmeldungTyp object ''' ''' File to load and deserialize ''' Output WarenPositionUeberlassungsmeldungTyp 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 WarenPositionUeberlassungsmeldungTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, WarenPositionUeberlassungsmeldungTyp) 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 WarenPositionUeberlassungsmeldungTyp) 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 WarenPositionUeberlassungsmeldungTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class AdresseMRTyp #Region "Private fields" Private _eORI As String Private _identifikationsart As String Private _nLNR As String Private _name As String Private _strasseHausnummer As String Private _land As String Private _pLZ As String Private _ort As String Private _ansprechpartner As AnsprechpartnerMRTyp Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._ansprechpartner = New AnsprechpartnerMRTyp() End Sub Public Property EORI() As String Get Return Me._eORI End Get Set Me._eORI = Value End Set End Property Public Property Identifikationsart() As String Get Return Me._identifikationsart End Get Set Me._identifikationsart = Value End Set End Property Public Property NLNR() As String Get Return Me._nLNR End Get Set Me._nLNR = Value End Set End Property Public Property Name() As String Get Return Me._name End Get Set Me._name = Value End Set End Property Public Property StrasseHausnummer() As String Get Return Me._strasseHausnummer End Get Set Me._strasseHausnummer = Value End Set End Property Public Property Land() As String Get Return Me._land End Get Set Me._land = Value End Set End Property Public Property PLZ() As String Get Return Me._pLZ End Get Set Me._pLZ = Value End Set End Property Public Property Ort() As String Get Return Me._ort End Get Set Me._ort = Value End Set End Property Public Property Ansprechpartner() As AnsprechpartnerMRTyp Get Return Me._ansprechpartner End Get Set Me._ansprechpartner = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AdresseMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AdresseMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes AdresseMRTyp object ''' ''' string to deserialize ''' Output AdresseMRTyp 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 AdresseMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdresseMRTyp) 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 AdresseMRTyp) 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 AdresseMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdresseMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As AdresseMRTyp Return CType(SerializerXml.Deserialize(s), AdresseMRTyp) End Function #End Region ''' ''' Serializes current AdresseMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an AdresseMRTyp object ''' ''' File to load and deserialize ''' Output AdresseMRTyp 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 AdresseMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdresseMRTyp) 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 AdresseMRTyp) 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 AdresseMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class AnsprechpartnerMRTyp #Region "Private fields" Private _sachbearbeiter As String Private _stellung As String Private _telefonnummer As String Private _telefaxnummer As String Private _emailAdresse As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Sachbearbeiter() As String Get Return Me._sachbearbeiter End Get Set Me._sachbearbeiter = Value End Set End Property Public Property Stellung() As String Get Return Me._stellung End Get Set Me._stellung = Value End Set End Property Public Property Telefonnummer() As String Get Return Me._telefonnummer End Get Set Me._telefonnummer = Value End Set End Property Public Property Telefaxnummer() As String Get Return Me._telefaxnummer End Get Set Me._telefaxnummer = Value End Set End Property Public Property EmailAdresse() As String Get Return Me._emailAdresse End Get Set Me._emailAdresse = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AnsprechpartnerMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AnsprechpartnerMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes AnsprechpartnerMRTyp object ''' ''' string to deserialize ''' Output AnsprechpartnerMRTyp 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 AnsprechpartnerMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AnsprechpartnerMRTyp) 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 AnsprechpartnerMRTyp) 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 AnsprechpartnerMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AnsprechpartnerMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As AnsprechpartnerMRTyp Return CType(SerializerXml.Deserialize(s), AnsprechpartnerMRTyp) End Function #End Region ''' ''' Serializes current AnsprechpartnerMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an AnsprechpartnerMRTyp object ''' ''' File to load and deserialize ''' Output AnsprechpartnerMRTyp 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 AnsprechpartnerMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AnsprechpartnerMRTyp) 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 AnsprechpartnerMRTyp) 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 AnsprechpartnerMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class VerschluesseMRTyp #Region "Private fields" Private _art As String Private _anzahl As String Private _zeichen As List(Of String) Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._zeichen = New List(Of String)() End Sub Public Property Art() As String Get Return Me._art End Get Set Me._art = Value End Set End Property Public Property Anzahl() As String Get Return Me._anzahl End Get Set Me._anzahl = Value End Set End Property Public Property Zeichen() As List(Of String) Get Return Me._zeichen End Get Set Me._zeichen = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(VerschluesseMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize VerschluesseMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes VerschluesseMRTyp object ''' ''' string to deserialize ''' Output VerschluesseMRTyp 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 VerschluesseMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, VerschluesseMRTyp) 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 VerschluesseMRTyp) 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 VerschluesseMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), VerschluesseMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As VerschluesseMRTyp Return CType(SerializerXml.Deserialize(s), VerschluesseMRTyp) End Function #End Region ''' ''' Serializes current VerschluesseMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an VerschluesseMRTyp object ''' ''' File to load and deserialize ''' Output VerschluesseMRTyp 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 VerschluesseMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, VerschluesseMRTyp) 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 VerschluesseMRTyp) 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 VerschluesseMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class AdresseTINKurzMRTyp #Region "Private fields" Private _eORI As String Private _nLNR As String Private _iDCarnet As String Private _name As String Private _strasseHausnummer As String Private _land As String Private _pLZ As String Private _ort As String Private _ansprechpartner As AnsprechpartnerMRTyp Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._ansprechpartner = New AnsprechpartnerMRTyp() End Sub Public Property EORI() As String Get Return Me._eORI End Get Set Me._eORI = Value End Set End Property Public Property NLNR() As String Get Return Me._nLNR End Get Set Me._nLNR = Value End Set End Property Public Property IDCarnet() As String Get Return Me._iDCarnet End Get Set Me._iDCarnet = Value End Set End Property Public Property Name() As String Get Return Me._name End Get Set Me._name = Value End Set End Property Public Property StrasseHausnummer() As String Get Return Me._strasseHausnummer End Get Set Me._strasseHausnummer = Value End Set End Property Public Property Land() As String Get Return Me._land End Get Set Me._land = Value End Set End Property Public Property PLZ() As String Get Return Me._pLZ End Get Set Me._pLZ = Value End Set End Property Public Property Ort() As String Get Return Me._ort End Get Set Me._ort = Value End Set End Property Public Property Ansprechpartner() As AnsprechpartnerMRTyp Get Return Me._ansprechpartner End Get Set Me._ansprechpartner = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AdresseTINKurzMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize AdresseTINKurzMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes AdresseTINKurzMRTyp object ''' ''' string to deserialize ''' Output AdresseTINKurzMRTyp 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 AdresseTINKurzMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdresseTINKurzMRTyp) 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 AdresseTINKurzMRTyp) 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 AdresseTINKurzMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdresseTINKurzMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As AdresseTINKurzMRTyp Return CType(SerializerXml.Deserialize(s), AdresseTINKurzMRTyp) End Function #End Region ''' ''' Serializes current AdresseTINKurzMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an AdresseTINKurzMRTyp object ''' ''' File to load and deserialize ''' Output AdresseTINKurzMRTyp 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 AdresseTINKurzMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, AdresseTINKurzMRTyp) 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 AdresseTINKurzMRTyp) 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 AdresseTINKurzMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class BefoerderungsmittelAbgangMRTyp #Region "Private fields" Private _staatszugehoerigkeit As String Private _kennzeichen As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Staatszugehoerigkeit() As String Get Return Me._staatszugehoerigkeit End Get Set Me._staatszugehoerigkeit = Value End Set End Property Public Property Kennzeichen() As String Get Return Me._kennzeichen End Get Set Me._kennzeichen = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(BefoerderungsmittelAbgangMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize BefoerderungsmittelAbgangMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes BefoerderungsmittelAbgangMRTyp object ''' ''' string to deserialize ''' Output BefoerderungsmittelAbgangMRTyp 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 BefoerderungsmittelAbgangMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, BefoerderungsmittelAbgangMRTyp) 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 BefoerderungsmittelAbgangMRTyp) 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 BefoerderungsmittelAbgangMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), BefoerderungsmittelAbgangMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As BefoerderungsmittelAbgangMRTyp Return CType(SerializerXml.Deserialize(s), BefoerderungsmittelAbgangMRTyp) End Function #End Region ''' ''' Serializes current BefoerderungsmittelAbgangMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an BefoerderungsmittelAbgangMRTyp object ''' ''' File to load and deserialize ''' Output BefoerderungsmittelAbgangMRTyp 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 BefoerderungsmittelAbgangMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, BefoerderungsmittelAbgangMRTyp) 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 BefoerderungsmittelAbgangMRTyp) 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 BefoerderungsmittelAbgangMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class VerbindlicheBefoerderungsrouteMRTyp #Region "Private fields" Private _beschreibung As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Beschreibung() As String Get Return Me._beschreibung End Get Set Me._beschreibung = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(VerbindlicheBefoerderungsrouteMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize VerbindlicheBefoerderungsrouteMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes VerbindlicheBefoerderungsrouteMRTyp object ''' ''' string to deserialize ''' Output VerbindlicheBefoerderungsrouteMRTyp 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 VerbindlicheBefoerderungsrouteMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, VerbindlicheBefoerderungsrouteMRTyp) 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 VerbindlicheBefoerderungsrouteMRTyp) 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 VerbindlicheBefoerderungsrouteMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), VerbindlicheBefoerderungsrouteMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As VerbindlicheBefoerderungsrouteMRTyp Return CType(SerializerXml.Deserialize(s), VerbindlicheBefoerderungsrouteMRTyp) End Function #End Region ''' ''' Serializes current VerbindlicheBefoerderungsrouteMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an VerbindlicheBefoerderungsrouteMRTyp object ''' ''' File to load and deserialize ''' Output VerbindlicheBefoerderungsrouteMRTyp 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 VerbindlicheBefoerderungsrouteMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, VerbindlicheBefoerderungsrouteMRTyp) 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 VerbindlicheBefoerderungsrouteMRTyp) 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 VerbindlicheBefoerderungsrouteMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class SicherheitMRTyp #Region "Private fields" Private _art As String Private _bezeichnung As String Private _betrag As Decimal Private _sicherheitengeberTIN As String Private _waehrung As String Private _bescheinigung As String Private Shared _serializerXml As XmlSerializer #End Region Public Property Art() As String Get Return Me._art End Get Set Me._art = Value End Set End Property Public Property Bezeichnung() As String Get Return Me._bezeichnung End Get Set Me._bezeichnung = Value End Set End Property Public Property Betrag() As Decimal Get Return Me._betrag End Get Set Me._betrag = Value End Set End Property Public Property SicherheitengeberTIN() As String Get Return Me._sicherheitengeberTIN End Get Set Me._sicherheitengeberTIN = Value End Set End Property Public Property Waehrung() As String Get Return Me._waehrung End Get Set Me._waehrung = Value End Set End Property Public Property Bescheinigung() As String Get Return Me._bescheinigung End Get Set Me._bescheinigung = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SicherheitMRTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize SicherheitMRTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes SicherheitMRTyp object ''' ''' string to deserialize ''' Output SicherheitMRTyp 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 SicherheitMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SicherheitMRTyp) 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 SicherheitMRTyp) 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 SicherheitMRTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SicherheitMRTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As SicherheitMRTyp Return CType(SerializerXml.Deserialize(s), SicherheitMRTyp) End Function #End Region ''' ''' Serializes current SicherheitMRTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an SicherheitMRTyp object ''' ''' File to load and deserialize ''' Output SicherheitMRTyp 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 SicherheitMRTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SicherheitMRTyp) 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 SicherheitMRTyp) 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 SicherheitMRTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class KopfDatenUeberlassungsmeldungTyp #Region "Private fields" Private _mRN As String Private _abgangszollstelle As String Private _annahmedatum As Date Private _ueberlassungsdatum As Date Private _wiedergestellungsdatum As Date Private _sicherheit As List(Of SicherheitMRTyp) Private _bestimmungszollstelle As String Private _vBDName As String Private _arbeitsnummer As String Private _kzSumASicherheit As String Private _kennnummerSendung As String Private _nummerBefoerderung As String Private _besondereUmstaende As String Private _ladeort As String Private _entladeort As String Private _befoerderungskostenZahlungsweise As String Private _artAnmeldung As String Private _anzahlPositionen As String Private _packstueckeGesamt As String Private _versendungsAusfuhrland As String Private _bestimmungsland As String Private _gesamtRohmasse As Decimal Private _kontrollErgebnis As String Private _verbindlicheBefoerderungsroute As VerbindlicheBefoerderungsrouteMRTyp Private _befoerderungsmittelAbgang As BefoerderungsmittelAbgangMRTyp Private _durchgangszollstelleNCTS As List(Of String) Private _befoerderungsrouteSumASicherheitLand As List(Of String) Private _versender As AdresseMRTyp Private _versenderSumASicherheit As AdresseMRTyp Private _empfaenger As AdresseMRTyp Private _empfaengerSumASicherheit As AdresseMRTyp Private _hauptverpflichteter As AdresseTINKurzMRTyp Private _befoerderer As AdresseMRTyp Private _zugelassenerEmpfaengerEORI As String Private _verschluesse As VerschluesseMRTyp Private _bewilligungZV As String Private _bewilligungBV As String Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._verschluesse = New VerschluesseMRTyp() Me._befoerderer = New AdresseMRTyp() Me._hauptverpflichteter = New AdresseTINKurzMRTyp() Me._empfaengerSumASicherheit = New AdresseMRTyp() Me._empfaenger = New AdresseMRTyp() Me._versenderSumASicherheit = New AdresseMRTyp() Me._versender = New AdresseMRTyp() Me._befoerderungsrouteSumASicherheitLand = New List(Of String)() Me._durchgangszollstelleNCTS = New List(Of String)() Me._befoerderungsmittelAbgang = New BefoerderungsmittelAbgangMRTyp() Me._verbindlicheBefoerderungsroute = New VerbindlicheBefoerderungsrouteMRTyp() Me._sicherheit = New List(Of SicherheitMRTyp)() End Sub Public Property MRN() As String Get Return Me._mRN End Get Set Me._mRN = Value End Set End Property Public Property Abgangszollstelle() As String Get Return Me._abgangszollstelle End Get Set Me._abgangszollstelle = Value End Set End Property Public Property Annahmedatum() As Date Get Return Me._annahmedatum End Get Set Me._annahmedatum = Value End Set End Property Public Property Ueberlassungsdatum() As Date Get Return Me._ueberlassungsdatum End Get Set Me._ueberlassungsdatum = Value End Set End Property Public Property Wiedergestellungsdatum() As Date Get Return Me._wiedergestellungsdatum End Get Set Me._wiedergestellungsdatum = Value End Set End Property Public Property Sicherheit() As List(Of SicherheitMRTyp) Get Return Me._sicherheit End Get Set Me._sicherheit = Value End Set End Property Public Property Bestimmungszollstelle() As String Get Return Me._bestimmungszollstelle End Get Set Me._bestimmungszollstelle = Value End Set End Property Public Property VBDName() As String Get Return Me._vBDName End Get Set Me._vBDName = Value End Set End Property Public Property Arbeitsnummer() As String Get Return Me._arbeitsnummer End Get Set Me._arbeitsnummer = Value End Set End Property Public Property KzSumASicherheit() As String Get Return Me._kzSumASicherheit End Get Set Me._kzSumASicherheit = Value End Set End Property Public Property KennnummerSendung() As String Get Return Me._kennnummerSendung End Get Set Me._kennnummerSendung = Value End Set End Property Public Property NummerBefoerderung() As String Get Return Me._nummerBefoerderung End Get Set Me._nummerBefoerderung = Value End Set End Property Public Property BesondereUmstaende() As String Get Return Me._besondereUmstaende End Get Set Me._besondereUmstaende = Value End Set End Property Public Property Ladeort() As String Get Return Me._ladeort End Get Set Me._ladeort = Value End Set End Property Public Property Entladeort() As String Get Return Me._entladeort End Get Set Me._entladeort = Value End Set End Property Public Property BefoerderungskostenZahlungsweise() As String Get Return Me._befoerderungskostenZahlungsweise End Get Set Me._befoerderungskostenZahlungsweise = Value End Set End Property Public Property ArtAnmeldung() As String Get Return Me._artAnmeldung End Get Set Me._artAnmeldung = Value End Set End Property Public Property AnzahlPositionen() As String Get Return Me._anzahlPositionen End Get Set Me._anzahlPositionen = Value End Set End Property Public Property PackstueckeGesamt() As String Get Return Me._packstueckeGesamt End Get Set Me._packstueckeGesamt = Value End Set End Property Public Property VersendungsAusfuhrland() As String Get Return Me._versendungsAusfuhrland End Get Set Me._versendungsAusfuhrland = Value End Set End Property Public Property Bestimmungsland() As String Get Return Me._bestimmungsland End Get Set Me._bestimmungsland = Value End Set End Property Public Property GesamtRohmasse() As Decimal Get Return Me._gesamtRohmasse End Get Set Me._gesamtRohmasse = Value End Set End Property Public Property KontrollErgebnis() As String Get Return Me._kontrollErgebnis End Get Set Me._kontrollErgebnis = Value End Set End Property Public Property VerbindlicheBefoerderungsroute() As VerbindlicheBefoerderungsrouteMRTyp Get Return Me._verbindlicheBefoerderungsroute End Get Set Me._verbindlicheBefoerderungsroute = Value End Set End Property Public Property BefoerderungsmittelAbgang() As BefoerderungsmittelAbgangMRTyp Get Return Me._befoerderungsmittelAbgang End Get Set Me._befoerderungsmittelAbgang = Value End Set End Property Public Property DurchgangszollstelleNCTS() As List(Of String) Get Return Me._durchgangszollstelleNCTS End Get Set Me._durchgangszollstelleNCTS = Value End Set End Property Public Property BefoerderungsrouteSumASicherheitLand() As List(Of String) Get Return Me._befoerderungsrouteSumASicherheitLand End Get Set Me._befoerderungsrouteSumASicherheitLand = Value End Set End Property Public Property Versender() As AdresseMRTyp Get Return Me._versender End Get Set Me._versender = Value End Set End Property Public Property VersenderSumASicherheit() As AdresseMRTyp Get Return Me._versenderSumASicherheit End Get Set Me._versenderSumASicherheit = Value End Set End Property Public Property Empfaenger() As AdresseMRTyp Get Return Me._empfaenger End Get Set Me._empfaenger = Value End Set End Property Public Property EmpfaengerSumASicherheit() As AdresseMRTyp Get Return Me._empfaengerSumASicherheit End Get Set Me._empfaengerSumASicherheit = Value End Set End Property Public Property Hauptverpflichteter() As AdresseTINKurzMRTyp Get Return Me._hauptverpflichteter End Get Set Me._hauptverpflichteter = Value End Set End Property Public Property Befoerderer() As AdresseMRTyp Get Return Me._befoerderer End Get Set Me._befoerderer = Value End Set End Property Public Property ZugelassenerEmpfaengerEORI() As String Get Return Me._zugelassenerEmpfaengerEORI End Get Set Me._zugelassenerEmpfaengerEORI = Value End Set End Property Public Property Verschluesse() As VerschluesseMRTyp Get Return Me._verschluesse End Get Set Me._verschluesse = Value End Set End Property Public Property BewilligungZV() As String Get Return Me._bewilligungZV End Get Set Me._bewilligungZV = Value End Set End Property Public Property BewilligungBV() As String Get Return Me._bewilligungBV End Get Set Me._bewilligungBV = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(KopfDatenUeberlassungsmeldungTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize KopfDatenUeberlassungsmeldungTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes KopfDatenUeberlassungsmeldungTyp object ''' ''' string to deserialize ''' Output KopfDatenUeberlassungsmeldungTyp 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 KopfDatenUeberlassungsmeldungTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, KopfDatenUeberlassungsmeldungTyp) 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 KopfDatenUeberlassungsmeldungTyp) 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 KopfDatenUeberlassungsmeldungTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), KopfDatenUeberlassungsmeldungTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As KopfDatenUeberlassungsmeldungTyp Return CType(SerializerXml.Deserialize(s), KopfDatenUeberlassungsmeldungTyp) End Function #End Region ''' ''' Serializes current KopfDatenUeberlassungsmeldungTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an KopfDatenUeberlassungsmeldungTyp object ''' ''' File to load and deserialize ''' Output KopfDatenUeberlassungsmeldungTyp 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 KopfDatenUeberlassungsmeldungTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, KopfDatenUeberlassungsmeldungTyp) 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 KopfDatenUeberlassungsmeldungTyp) 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 KopfDatenUeberlassungsmeldungTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class TransaktionNCTSTyp #Region "Private fields" Private _iOPartner As String Private _iODivision1 As String Private _iODivision2 As String Private _iODivision3 As String Private _iOReferenz As String Private _iODatumZeit As Date Private _version As String Private Shared _serializerXml As XmlSerializer #End Region Public Property IOPartner() As String Get Return Me._iOPartner End Get Set Me._iOPartner = Value End Set End Property Public Property IODivision1() As String Get Return Me._iODivision1 End Get Set Me._iODivision1 = Value End Set End Property Public Property IODivision2() As String Get Return Me._iODivision2 End Get Set Me._iODivision2 = Value End Set End Property Public Property IODivision3() As String Get Return Me._iODivision3 End Get Set Me._iODivision3 = Value End Set End Property Public Property IOReferenz() As String Get Return Me._iOReferenz End Get Set Me._iOReferenz = Value End Set End Property Public Property IODatumZeit() As Date Get Return Me._iODatumZeit End Get Set Me._iODatumZeit = Value End Set End Property Public Property Version() As String Get Return Me._version End Get Set Me._version = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransaktionNCTSTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize TransaktionNCTSTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes TransaktionNCTSTyp object ''' ''' string to deserialize ''' Output TransaktionNCTSTyp object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TransaktionNCTSTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransaktionNCTSTyp) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TransaktionNCTSTyp) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As TransaktionNCTSTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransaktionNCTSTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As TransaktionNCTSTyp Return CType(SerializerXml.Deserialize(s), TransaktionNCTSTyp) End Function #End Region ''' ''' Serializes current TransaktionNCTSTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an TransaktionNCTSTyp object ''' ''' File to load and deserialize ''' Output TransaktionNCTSTyp object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TransaktionNCTSTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransaktionNCTSTyp) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TransaktionNCTSTyp) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TransaktionNCTSTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class DatenaustauschNCTSTyp #Region "Private fields" Private _transaktion As TransaktionNCTSTyp Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._transaktion = New TransaktionNCTSTyp() End Sub Public Property Transaktion() As TransaktionNCTSTyp Get Return Me._transaktion End Get Set Me._transaktion = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(DatenaustauschNCTSTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize DatenaustauschNCTSTyp object ''' ''' XML value Public Overridable Function Serialize() As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes DatenaustauschNCTSTyp object ''' ''' string to deserialize ''' Output DatenaustauschNCTSTyp object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DatenaustauschNCTSTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DatenaustauschNCTSTyp) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DatenaustauschNCTSTyp) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As DatenaustauschNCTSTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), DatenaustauschNCTSTyp) Finally If (Not (stringReader) Is Nothing) Then stringReader.Dispose() End If End Try End Function Public Overloads Shared Function Deserialize(ByVal s As Stream) As DatenaustauschNCTSTyp Return CType(SerializerXml.Deserialize(s), DatenaustauschNCTSTyp) End Function #End Region ''' ''' Serializes current DatenaustauschNCTSTyp object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As StreamWriter = Nothing Try Dim dataString As String = Serialize() Dim outputFile As FileInfo = New FileInfo(fileName) streamWriter = outputFile.CreateText streamWriter.WriteLine(dataString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an DatenaustauschNCTSTyp object ''' ''' File to load and deserialize ''' Output DatenaustauschNCTSTyp object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DatenaustauschNCTSTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, DatenaustauschNCTSTyp) Try obj = LoadFromFile(fileName) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DatenaustauschNCTSTyp) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As DatenaustauschNCTSTyp Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New StreamReader(file) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(dataString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class End Namespace #Enable Warning