1833 lines
75 KiB
VB.net
1833 lines
75 KiB
VB.net
'' ------------------------------------------------------------------------------
|
|
'' <auto-generated>
|
|
'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com
|
|
'' {"TargetFramework":"Net47","NameSpace":"ErledigungsmeldungNCTSDE_003","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{},"JsonOutput":{},"Enabled":true},"Miscellaneous":{}}
|
|
'' </auto-generated>
|
|
'' ------------------------------------------------------------------------------
|
|
#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 ErledigungsmeldungNCTSDE_003
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"), _
|
|
System.Serializable, _
|
|
DebuggerStepThrough, _
|
|
DesignerCategoryAttribute("code"), _
|
|
XmlRoot("ErledigungsmeldungNCTSDE", [Namespace]:="", IsNullable:=false)> _
|
|
Partial Public Class ErledigungsmeldungMOTyp
|
|
Inherits DatenaustauschNCTSTyp
|
|
|
|
#Region "Private fields"
|
|
Private _einzelErledigungsmeldung As EinzelErledigungsmeldungTyp
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._einzelErledigungsmeldung = New EinzelErledigungsmeldungTyp()
|
|
End Sub
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
Public Property EinzelErledigungsmeldung() As EinzelErledigungsmeldungTyp
|
|
Get
|
|
Return Me._einzelErledigungsmeldung
|
|
End Get
|
|
Set
|
|
Me._einzelErledigungsmeldung = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ErledigungsmeldungMOTyp))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize ErledigungsmeldungMOTyp object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes ErledigungsmeldungMOTyp object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output ErledigungsmeldungMOTyp object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ErledigungsmeldungMOTyp, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ErledigungsmeldungMOTyp)
|
|
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 ErledigungsmeldungMOTyp) 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 ErledigungsmeldungMOTyp
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),ErledigungsmeldungMOTyp)
|
|
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 ErledigungsmeldungMOTyp
|
|
Return CType(SerializerXml.Deserialize(s),ErledigungsmeldungMOTyp)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current ErledigungsmeldungMOTyp object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overloads Overridable 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 Overloads Overridable 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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an ErledigungsmeldungMOTyp object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output ErledigungsmeldungMOTyp object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ErledigungsmeldungMOTyp, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ErledigungsmeldungMOTyp)
|
|
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 ErledigungsmeldungMOTyp) 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 ErledigungsmeldungMOTyp
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"), _
|
|
System.Serializable, _
|
|
DebuggerStepThrough, _
|
|
DesignerCategoryAttribute("code")> _
|
|
Partial Public Class EinzelErledigungsmeldungTyp
|
|
|
|
#Region "Private fields"
|
|
Private _objektIdentifizierung As ObjektIdentifizierungMOTyp
|
|
|
|
Private _kopfDaten As KopfDatenErledigungsmeldungTyp
|
|
|
|
Private _transitOperation As TransitOperationMOType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._transitOperation = New TransitOperationMOType()
|
|
Me._kopfDaten = New KopfDatenErledigungsmeldungTyp()
|
|
Me._objektIdentifizierung = New ObjektIdentifizierungMOTyp()
|
|
End Sub
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
Public Property ObjektIdentifizierung() As ObjektIdentifizierungMOTyp
|
|
Get
|
|
Return Me._objektIdentifizierung
|
|
End Get
|
|
Set
|
|
Me._objektIdentifizierung = value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
Public Property KopfDaten() As KopfDatenErledigungsmeldungTyp
|
|
Get
|
|
Return Me._kopfDaten
|
|
End Get
|
|
Set
|
|
Me._kopfDaten = value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
Public Property TransitOperation() As TransitOperationMOType
|
|
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(EinzelErledigungsmeldungTyp))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize EinzelErledigungsmeldungTyp object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes EinzelErledigungsmeldungTyp object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output EinzelErledigungsmeldungTyp object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As EinzelErledigungsmeldungTyp, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, EinzelErledigungsmeldungTyp)
|
|
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 EinzelErledigungsmeldungTyp) 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 EinzelErledigungsmeldungTyp
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),EinzelErledigungsmeldungTyp)
|
|
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 EinzelErledigungsmeldungTyp
|
|
Return CType(SerializerXml.Deserialize(s),EinzelErledigungsmeldungTyp)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current EinzelErledigungsmeldungTyp object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overloads Overridable 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 Overloads Overridable 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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an EinzelErledigungsmeldungTyp object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output EinzelErledigungsmeldungTyp object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As EinzelErledigungsmeldungTyp, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, EinzelErledigungsmeldungTyp)
|
|
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 EinzelErledigungsmeldungTyp) 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 EinzelErledigungsmeldungTyp
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"), _
|
|
System.Serializable, _
|
|
DebuggerStepThrough, _
|
|
DesignerCategoryAttribute("code")> _
|
|
Partial Public Class ObjektIdentifizierungMOTyp
|
|
|
|
#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
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
Public Property ObjektName() As String
|
|
Get
|
|
Return Me._objektName
|
|
End Get
|
|
Set
|
|
Me._objektName = value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
Public Property ObjektAlias() As String
|
|
Get
|
|
Return Me._objektAlias
|
|
End Get
|
|
Set
|
|
Me._objektAlias = value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
Public Property EDIFACTNachrichtenNr() As String
|
|
Get
|
|
Return Me._eDIFACTNachrichtenNr
|
|
End Get
|
|
Set
|
|
Me._eDIFACTNachrichtenNr = value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
Public Property ZeitpunktEingang() As Date
|
|
Get
|
|
Return Me._zeitpunktEingang
|
|
End Get
|
|
Set
|
|
Me._zeitpunktEingang = value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
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(ObjektIdentifizierungMOTyp))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize ObjektIdentifizierungMOTyp object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes ObjektIdentifizierungMOTyp object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output ObjektIdentifizierungMOTyp object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ObjektIdentifizierungMOTyp, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ObjektIdentifizierungMOTyp)
|
|
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 ObjektIdentifizierungMOTyp) 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 ObjektIdentifizierungMOTyp
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),ObjektIdentifizierungMOTyp)
|
|
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 ObjektIdentifizierungMOTyp
|
|
Return CType(SerializerXml.Deserialize(s),ObjektIdentifizierungMOTyp)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current ObjektIdentifizierungMOTyp object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overloads Overridable 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 Overloads Overridable 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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an ObjektIdentifizierungMOTyp object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output ObjektIdentifizierungMOTyp object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ObjektIdentifizierungMOTyp, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, ObjektIdentifizierungMOTyp)
|
|
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 ObjektIdentifizierungMOTyp) 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 ObjektIdentifizierungMOTyp
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"), _
|
|
System.Serializable, _
|
|
DebuggerStepThrough, _
|
|
DesignerCategoryAttribute("code")> _
|
|
Partial Public Class ApplicationInternalDataAdditionalDetailsDataType
|
|
|
|
#Region "Private fields"
|
|
Private _key As String
|
|
|
|
Private _value As String
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
Public Property Key() As String
|
|
Get
|
|
Return Me._key
|
|
End Get
|
|
Set
|
|
Me._key = value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
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"
|
|
''' <summary>
|
|
''' Serialize ApplicationInternalDataAdditionalDetailsDataType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes ApplicationInternalDataAdditionalDetailsDataType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output ApplicationInternalDataAdditionalDetailsDataType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Serializes current ApplicationInternalDataAdditionalDetailsDataType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overloads Overridable 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 Overloads Overridable 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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an ApplicationInternalDataAdditionalDetailsDataType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output ApplicationInternalDataAdditionalDetailsDataType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"), _
|
|
System.Serializable, _
|
|
DebuggerStepThrough, _
|
|
DesignerCategoryAttribute("code")> _
|
|
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
|
|
|
|
<XmlArray(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified), _
|
|
XmlArrayItem("Data", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable:=false)> _
|
|
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"
|
|
''' <summary>
|
|
''' Serialize ApplicationInternalDataType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes ApplicationInternalDataType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output ApplicationInternalDataType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Serializes current ApplicationInternalDataType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overloads Overridable 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 Overloads Overridable 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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an ApplicationInternalDataType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output ApplicationInternalDataType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"), _
|
|
System.Serializable, _
|
|
DebuggerStepThrough, _
|
|
DesignerCategoryAttribute("code")> _
|
|
Partial Public Class TransitOperationMOType
|
|
|
|
#Region "Private fields"
|
|
Private _departureStatus As String
|
|
|
|
Private _mRN As String
|
|
|
|
Private _completionDateAndTime As Date
|
|
|
|
Private _applicationInternalData As ApplicationInternalDataType
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._applicationInternalData = New ApplicationInternalDataType()
|
|
End Sub
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
Public Property DepartureStatus() As String
|
|
Get
|
|
Return Me._departureStatus
|
|
End Get
|
|
Set
|
|
Me._departureStatus = value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
Public Property MRN() As String
|
|
Get
|
|
Return Me._mRN
|
|
End Get
|
|
Set
|
|
Me._mRN = value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
Public Property CompletionDateAndTime() As Date
|
|
Get
|
|
Return Me._completionDateAndTime
|
|
End Get
|
|
Set
|
|
Me._completionDateAndTime = value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
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(TransitOperationMOType))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize TransitOperationMOType object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes TransitOperationMOType object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TransitOperationMOType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TransitOperationMOType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TransitOperationMOType)
|
|
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 TransitOperationMOType) 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 TransitOperationMOType
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TransitOperationMOType)
|
|
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 TransitOperationMOType
|
|
Return CType(SerializerXml.Deserialize(s),TransitOperationMOType)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current TransitOperationMOType object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overloads Overridable 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 Overloads Overridable 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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an TransitOperationMOType object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TransitOperationMOType object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TransitOperationMOType, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, TransitOperationMOType)
|
|
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 TransitOperationMOType) 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 TransitOperationMOType
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"), _
|
|
System.Serializable, _
|
|
DebuggerStepThrough, _
|
|
DesignerCategoryAttribute("code")> _
|
|
Partial Public Class KopfDatenErledigungsmeldungTyp
|
|
|
|
#Region "Private fields"
|
|
Private _mRN As String
|
|
|
|
Private _zeitpunktErledigung As Date
|
|
|
|
Private Shared _serializerXml As XmlSerializer
|
|
#End Region
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
Public Property MRN() As String
|
|
Get
|
|
Return Me._mRN
|
|
End Get
|
|
Set
|
|
Me._mRN = value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
Public Property ZeitpunktErledigung() As Date
|
|
Get
|
|
Return Me._zeitpunktErledigung
|
|
End Get
|
|
Set
|
|
Me._zeitpunktErledigung = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
|
|
Get
|
|
If (_serializerXml Is Nothing) Then
|
|
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(KopfDatenErledigungsmeldungTyp))
|
|
End If
|
|
Return _serializerXml
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serialize KopfDatenErledigungsmeldungTyp object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes KopfDatenErledigungsmeldungTyp object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output KopfDatenErledigungsmeldungTyp object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As KopfDatenErledigungsmeldungTyp, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, KopfDatenErledigungsmeldungTyp)
|
|
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 KopfDatenErledigungsmeldungTyp) 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 KopfDatenErledigungsmeldungTyp
|
|
Dim stringReader As StringReader = Nothing
|
|
Try
|
|
stringReader = New StringReader(input)
|
|
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),KopfDatenErledigungsmeldungTyp)
|
|
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 KopfDatenErledigungsmeldungTyp
|
|
Return CType(SerializerXml.Deserialize(s),KopfDatenErledigungsmeldungTyp)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current KopfDatenErledigungsmeldungTyp object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overloads Overridable 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 Overloads Overridable 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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an KopfDatenErledigungsmeldungTyp object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output KopfDatenErledigungsmeldungTyp object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As KopfDatenErledigungsmeldungTyp, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, KopfDatenErledigungsmeldungTyp)
|
|
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 KopfDatenErledigungsmeldungTyp) 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 KopfDatenErledigungsmeldungTyp
|
|
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
|
|
|
|
<System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"), _
|
|
System.Serializable, _
|
|
DebuggerStepThrough, _
|
|
DesignerCategoryAttribute("code")> _
|
|
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
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
Public Property IOPartner() As String
|
|
Get
|
|
Return Me._iOPartner
|
|
End Get
|
|
Set
|
|
Me._iOPartner = value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
Public Property IODivision1() As String
|
|
Get
|
|
Return Me._iODivision1
|
|
End Get
|
|
Set
|
|
Me._iODivision1 = value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
Public Property IODivision2() As String
|
|
Get
|
|
Return Me._iODivision2
|
|
End Get
|
|
Set
|
|
Me._iODivision2 = value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
Public Property IODivision3() As String
|
|
Get
|
|
Return Me._iODivision3
|
|
End Get
|
|
Set
|
|
Me._iODivision3 = value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
Public Property IOReferenz() As String
|
|
Get
|
|
Return Me._iOReferenz
|
|
End Get
|
|
Set
|
|
Me._iOReferenz = value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
Public Property IODatumZeit() As Date
|
|
Get
|
|
Return Me._iODatumZeit
|
|
End Get
|
|
Set
|
|
Me._iODatumZeit = value
|
|
End Set
|
|
End Property
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="nonNegativeInteger")> _
|
|
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"
|
|
''' <summary>
|
|
''' Serialize TransaktionNCTSTyp object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes TransaktionNCTSTyp object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output TransaktionNCTSTyp object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Serializes current TransaktionNCTSTyp object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overloads Overridable 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 Overloads Overridable 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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an TransaktionNCTSTyp object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output TransaktionNCTSTyp object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
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
|
|
|
|
<XmlIncludeAttribute(GetType(ErledigungsmeldungMOTyp)), _
|
|
System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"), _
|
|
System.Serializable, _
|
|
DebuggerStepThrough, _
|
|
DesignerCategoryAttribute("code")> _
|
|
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
|
|
|
|
<XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
|
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"
|
|
''' <summary>
|
|
''' Serialize DatenaustauschNCTSTyp object
|
|
''' </summary>
|
|
''' <returns>XML value</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Deserializes DatenaustauschNCTSTyp object
|
|
''' </summary>
|
|
''' <param name="input">string to deserialize</param>
|
|
''' <param name="obj">Output DatenaustauschNCTSTyp object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
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
|
|
|
|
''' <summary>
|
|
''' Serializes current DatenaustauschNCTSTyp object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overloads Overridable 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 Overloads Overridable 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
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an DatenaustauschNCTSTyp object
|
|
''' </summary>
|
|
''' <param name="fileName">File to load and deserialize</param>
|
|
''' <param name="obj">Output DatenaustauschNCTSTyp object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
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
|