'' ------------------------------------------------------------------------------ '' '' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com '' {"TargetFramework":"Net47","NameSpace":"EreignismitteilungNCTSDE_001","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{},"JsonOutput":{},"Enabled":true},"Miscellaneous":{}} '' '' ------------------------------------------------------------------------------ #Disable Warning Imports System Imports System.Diagnostics Imports System.Xml.Serialization Imports System.Runtime.Serialization Imports System.Collections Imports System.Xml.Schema Imports System.ComponentModel Imports System.Xml Imports System.IO Imports System.Text Imports System.Collections.Generic Namespace EreignismitteilungNCTSDE_001 Partial Public Class EreignismitteilungMETyp Inherits DatenaustauschNCTSTyp #Region "Private fields" Private _einzelEreignismitteilung As EinzelEreignismitteilungTyp Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._einzelEreignismitteilung = New EinzelEreignismitteilungTyp() End Sub Public Property EinzelEreignismitteilung() As EinzelEreignismitteilungTyp Get Return Me._einzelEreignismitteilung End Get Set Me._einzelEreignismitteilung = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(EreignismitteilungMETyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize EreignismitteilungMETyp 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 EreignismitteilungMETyp object ''' ''' string to deserialize ''' Output EreignismitteilungMETyp object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As EreignismitteilungMETyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, EreignismitteilungMETyp) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As EreignismitteilungMETyp) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As EreignismitteilungMETyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), EreignismitteilungMETyp) 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 EreignismitteilungMETyp Return CType(SerializerXml.Deserialize(s), EreignismitteilungMETyp) End Function #End Region ''' ''' Serializes current EreignismitteilungMETyp object into file ''' ''' full path of outupt xml file ''' 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 EreignismitteilungMETyp object ''' ''' File to load and deserialize ''' Output EreignismitteilungMETyp object ''' output 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 EreignismitteilungMETyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, EreignismitteilungMETyp) 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 EreignismitteilungMETyp) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As EreignismitteilungMETyp 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 EinzelEreignismitteilungTyp #Region "Private fields" Private _objektIdentifizierung As ObjektIdentifizierungMETyp Private _transitOperation As TransitOperationMEType Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._transitOperation = New TransitOperationMEType() Me._objektIdentifizierung = New ObjektIdentifizierungMETyp() End Sub Public Property ObjektIdentifizierung() As ObjektIdentifizierungMETyp Get Return Me._objektIdentifizierung End Get Set Me._objektIdentifizierung = Value End Set End Property Public Property TransitOperation() As TransitOperationMEType Get Return Me._transitOperation End Get Set Me._transitOperation = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(EinzelEreignismitteilungTyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize EinzelEreignismitteilungTyp 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 EinzelEreignismitteilungTyp object ''' ''' string to deserialize ''' Output EinzelEreignismitteilungTyp object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As EinzelEreignismitteilungTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, EinzelEreignismitteilungTyp) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As EinzelEreignismitteilungTyp) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As EinzelEreignismitteilungTyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), EinzelEreignismitteilungTyp) 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 EinzelEreignismitteilungTyp Return CType(SerializerXml.Deserialize(s), EinzelEreignismitteilungTyp) End Function #End Region ''' ''' Serializes current EinzelEreignismitteilungTyp object into file ''' ''' full path of outupt xml file ''' 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 EinzelEreignismitteilungTyp object ''' ''' File to load and deserialize ''' Output EinzelEreignismitteilungTyp object ''' output 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 EinzelEreignismitteilungTyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, EinzelEreignismitteilungTyp) 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 EinzelEreignismitteilungTyp) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As EinzelEreignismitteilungTyp 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 ObjektIdentifizierungMETyp #Region "Private fields" Private _objektName 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 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(ObjektIdentifizierungMETyp)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize ObjektIdentifizierungMETyp 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 ObjektIdentifizierungMETyp object ''' ''' string to deserialize ''' Output ObjektIdentifizierungMETyp object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ObjektIdentifizierungMETyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ObjektIdentifizierungMETyp) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ObjektIdentifizierungMETyp) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As ObjektIdentifizierungMETyp Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ObjektIdentifizierungMETyp) 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 ObjektIdentifizierungMETyp Return CType(SerializerXml.Deserialize(s), ObjektIdentifizierungMETyp) End Function #End Region ''' ''' Serializes current ObjektIdentifizierungMETyp object into file ''' ''' full path of outupt xml file ''' 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 ObjektIdentifizierungMETyp object ''' ''' File to load and deserialize ''' Output ObjektIdentifizierungMETyp object ''' output 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 ObjektIdentifizierungMETyp, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ObjektIdentifizierungMETyp) 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 ObjektIdentifizierungMETyp) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As ObjektIdentifizierungMETyp 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 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 TranshipmentMEType #Region "Private fields" Private _containerIndicator As String Private _typeOfIdentificationOfTransportMeans As String Private _identificationNumberOfTransportMeans As String Private _nationalityOfTransportMeans As String Private Shared _serializerXml As XmlSerializer #End Region Public Property ContainerIndicator() As String Get Return Me._containerIndicator End Get Set Me._containerIndicator = Value End Set End Property Public Property TypeOfIdentificationOfTransportMeans() As String Get Return Me._typeOfIdentificationOfTransportMeans End Get Set Me._typeOfIdentificationOfTransportMeans = Value End Set End Property Public Property IdentificationNumberOfTransportMeans() As String Get Return Me._identificationNumberOfTransportMeans End Get Set Me._identificationNumberOfTransportMeans = Value End Set End Property Public Property NationalityOfTransportMeans() As String Get Return Me._nationalityOfTransportMeans End Get Set Me._nationalityOfTransportMeans = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TranshipmentMEType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize TranshipmentMEType 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 TranshipmentMEType object ''' ''' string to deserialize ''' Output TranshipmentMEType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TranshipmentMEType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TranshipmentMEType) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TranshipmentMEType) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As TranshipmentMEType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TranshipmentMEType) 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 TranshipmentMEType Return CType(SerializerXml.Deserialize(s), TranshipmentMEType) End Function #End Region ''' ''' Serializes current TranshipmentMEType object into file ''' ''' full path of outupt xml file ''' 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 TranshipmentMEType object ''' ''' File to load and deserialize ''' Output TranshipmentMEType object ''' output 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 TranshipmentMEType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TranshipmentMEType) 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 TranshipmentMEType) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TranshipmentMEType 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 TransportEquipmentMEType #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(TransportEquipmentMEType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize TransportEquipmentMEType 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 TransportEquipmentMEType object ''' ''' string to deserialize ''' Output TransportEquipmentMEType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TransportEquipmentMEType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransportEquipmentMEType) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TransportEquipmentMEType) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As TransportEquipmentMEType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransportEquipmentMEType) 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 TransportEquipmentMEType Return CType(SerializerXml.Deserialize(s), TransportEquipmentMEType) End Function #End Region ''' ''' Serializes current TransportEquipmentMEType object into file ''' ''' full path of outupt xml file ''' 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 TransportEquipmentMEType object ''' ''' File to load and deserialize ''' Output TransportEquipmentMEType object ''' output 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 TransportEquipmentMEType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransportEquipmentMEType) 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 TransportEquipmentMEType) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TransportEquipmentMEType 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 IncidentMEType #Region "Private fields" Private _code As String Private _text As String Private _dateOfEndorsement As Date Private _authorityOfEndorsement As String Private _placeOfEndorsement As String Private _countryOfEndorsement As String Private _qualifierOfIdentificationOfLocation As String Private _countryOfLocation As String Private _uNLocode As String Private _latitude As String Private _longitude As String Private _streetAndNumberOfLocation As String Private _cityOfLocation As String Private _postcodeOfLocation As String Private _transportEquipment As List(Of TransportEquipmentMEType) Private _transhipment As TranshipmentMEType Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._transhipment = New TranshipmentMEType() Me._transportEquipment = New List(Of TransportEquipmentMEType)() End Sub 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 Public Property DateOfEndorsement() As Date Get Return Me._dateOfEndorsement End Get Set Me._dateOfEndorsement = Value End Set End Property Public Property AuthorityOfEndorsement() As String Get Return Me._authorityOfEndorsement End Get Set Me._authorityOfEndorsement = Value End Set End Property Public Property PlaceOfEndorsement() As String Get Return Me._placeOfEndorsement End Get Set Me._placeOfEndorsement = Value End Set End Property Public Property CountryOfEndorsement() As String Get Return Me._countryOfEndorsement End Get Set Me._countryOfEndorsement = Value End Set End Property Public Property QualifierOfIdentificationOfLocation() As String Get Return Me._qualifierOfIdentificationOfLocation End Get Set Me._qualifierOfIdentificationOfLocation = Value End Set End Property Public Property CountryOfLocation() As String Get Return Me._countryOfLocation End Get Set Me._countryOfLocation = Value End Set End Property Public Property UNLocode() As String Get Return Me._uNLocode End Get Set Me._uNLocode = Value End Set End Property Public Property Latitude() As String Get Return Me._latitude End Get Set Me._latitude = Value End Set End Property Public Property Longitude() As String Get Return Me._longitude End Get Set Me._longitude = Value End Set End Property Public Property StreetAndNumberOfLocation() As String Get Return Me._streetAndNumberOfLocation End Get Set Me._streetAndNumberOfLocation = Value End Set End Property Public Property CityOfLocation() As String Get Return Me._cityOfLocation End Get Set Me._cityOfLocation = Value End Set End Property Public Property PostcodeOfLocation() As String Get Return Me._postcodeOfLocation End Get Set Me._postcodeOfLocation = Value End Set End Property Public Property TransportEquipment() As List(Of TransportEquipmentMEType) Get Return Me._transportEquipment End Get Set Me._transportEquipment = Value End Set End Property Public Property Transhipment() As TranshipmentMEType Get Return Me._transhipment End Get Set Me._transhipment = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(IncidentMEType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize IncidentMEType 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 IncidentMEType object ''' ''' string to deserialize ''' Output IncidentMEType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As IncidentMEType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, IncidentMEType) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As IncidentMEType) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As IncidentMEType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), IncidentMEType) 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 IncidentMEType Return CType(SerializerXml.Deserialize(s), IncidentMEType) End Function #End Region ''' ''' Serializes current IncidentMEType object into file ''' ''' full path of outupt xml file ''' 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 IncidentMEType object ''' ''' File to load and deserialize ''' Output IncidentMEType object ''' output 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 IncidentMEType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, IncidentMEType) 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 IncidentMEType) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As IncidentMEType 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 RepresentativeMEType #Region "Private fields" Private _identificationNumber As String Private Shared _serializerXml As XmlSerializer #End Region Public Property IdentificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = Value End Set End Property Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(RepresentativeMEType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize RepresentativeMEType 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 RepresentativeMEType object ''' ''' string to deserialize ''' Output RepresentativeMEType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As RepresentativeMEType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, RepresentativeMEType) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As RepresentativeMEType) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As RepresentativeMEType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), RepresentativeMEType) 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 RepresentativeMEType Return CType(SerializerXml.Deserialize(s), RepresentativeMEType) End Function #End Region ''' ''' Serializes current RepresentativeMEType object into file ''' ''' full path of outupt xml file ''' 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 RepresentativeMEType object ''' ''' File to load and deserialize ''' Output RepresentativeMEType object ''' output 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 RepresentativeMEType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, RepresentativeMEType) 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 RepresentativeMEType) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As RepresentativeMEType 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 HolderOfTheTransitProcedureMEType #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 Shared _serializerXml As XmlSerializer #End Region Public Property IdentificationNumber() As String Get Return Me._identificationNumber End Get Set Me._identificationNumber = Value End Set End Property 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 Private Shared ReadOnly Property SerializerXml() As XmlSerializer Get If (_serializerXml Is Nothing) Then _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(HolderOfTheTransitProcedureMEType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize HolderOfTheTransitProcedureMEType 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 HolderOfTheTransitProcedureMEType object ''' ''' string to deserialize ''' Output HolderOfTheTransitProcedureMEType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As HolderOfTheTransitProcedureMEType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, HolderOfTheTransitProcedureMEType) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As HolderOfTheTransitProcedureMEType) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As HolderOfTheTransitProcedureMEType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HolderOfTheTransitProcedureMEType) 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 HolderOfTheTransitProcedureMEType Return CType(SerializerXml.Deserialize(s), HolderOfTheTransitProcedureMEType) End Function #End Region ''' ''' Serializes current HolderOfTheTransitProcedureMEType object into file ''' ''' full path of outupt xml file ''' 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 HolderOfTheTransitProcedureMEType object ''' ''' File to load and deserialize ''' Output HolderOfTheTransitProcedureMEType object ''' output 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 HolderOfTheTransitProcedureMEType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, HolderOfTheTransitProcedureMEType) 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 HolderOfTheTransitProcedureMEType) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As HolderOfTheTransitProcedureMEType 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 TransitOperationMEType #Region "Private fields" Private _mRN As String Private _incidentNotificationDateAndTime As Date Private _customsOfficeOfDeparture As String Private _customsOfficeOfIncidentRegistration As String Private _holderOfTheTransitProcedure As HolderOfTheTransitProcedureMEType Private _representative As RepresentativeMEType Private _incident As List(Of IncidentMEType) Private _applicationInternalData As ApplicationInternalDataType Private Shared _serializerXml As XmlSerializer #End Region Public Sub New() MyBase.New Me._applicationInternalData = New ApplicationInternalDataType() Me._incident = New List(Of IncidentMEType)() Me._representative = New RepresentativeMEType() Me._holderOfTheTransitProcedure = New HolderOfTheTransitProcedureMEType() End Sub Public Property MRN() As String Get Return Me._mRN End Get Set Me._mRN = Value End Set End Property Public Property IncidentNotificationDateAndTime() As Date Get Return Me._incidentNotificationDateAndTime End Get Set Me._incidentNotificationDateAndTime = 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 CustomsOfficeOfIncidentRegistration() As String Get Return Me._customsOfficeOfIncidentRegistration End Get Set Me._customsOfficeOfIncidentRegistration = Value End Set End Property Public Property HolderOfTheTransitProcedure() As HolderOfTheTransitProcedureMEType Get Return Me._holderOfTheTransitProcedure End Get Set Me._holderOfTheTransitProcedure = Value End Set End Property Public Property Representative() As RepresentativeMEType Get Return Me._representative End Get Set Me._representative = Value End Set End Property Public Property Incident() As List(Of IncidentMEType) Get Return Me._incident End Get Set Me._incident = 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(TransitOperationMEType)) End If Return _serializerXml End Get End Property #Region "Serialize/Deserialize" ''' ''' Serialize TransitOperationMEType 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 TransitOperationMEType object ''' ''' string to deserialize ''' Output TransitOperationMEType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TransitOperationMEType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransitOperationMEType) Try obj = Deserialize(input) Return True Catch ex As System.Exception exception = ex Return False End Try End Function Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TransitOperationMEType) As Boolean Dim exception As System.Exception = Nothing Return Deserialize(input, obj, exception) End Function Public Overloads Shared Function Deserialize(ByVal input As String) As TransitOperationMEType Dim stringReader As StringReader = Nothing Try stringReader = New StringReader(input) Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransitOperationMEType) 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 TransitOperationMEType Return CType(SerializerXml.Deserialize(s), TransitOperationMEType) End Function #End Region ''' ''' Serializes current TransitOperationMEType object into file ''' ''' full path of outupt xml file ''' 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 TransitOperationMEType object ''' ''' File to load and deserialize ''' Output TransitOperationMEType object ''' output 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 TransitOperationMEType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TransitOperationMEType) 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 TransitOperationMEType) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TransitOperationMEType 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