'' ------------------------------------------------------------------------------
''
'' Generated by Xsd2Code++. Version 4.4.0.7
'' DETBAEListVisualBasicFalseFalseFalseOnlyIfDifferentFalseNet45AllTrueTrueTrueFalseFalseFalseFalseFalseNoneStartWithUnderscoreFalseFalseFalseFalseFalsePublicTrueFalseFalseFalseFalseFalseFalseFalseFalseTrueTrueTrueFalseTrueSerializeDeserializeSaveToFileLoadFromFileFalseTrueIndent2SpaceFalseFalseUTF8XmlSerializerFalseFalseFalseFalseFalseFalseFalseEntityBaseFalseFalse
''
'' ------------------------------------------------------------------------------
Imports System
Imports System.Diagnostics
Imports System.Xml.Serialization
Imports System.Collections
Imports System.Xml.Schema
Imports System.ComponentModel
Imports System.IO
Imports System.Text
Imports System.Xml
Imports System.Collections.Generic
Namespace DETBAE
Partial Public Class DETBAE
#Region "Private fields"
Private _metaData As DETBAEMetaData
Private _header As DETBAEHeader
Private _authorisedConsignee As DETBAEAuthorisedConsignee
Private Shared sSerializer As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._authorisedConsignee = New DETBAEAuthorisedConsignee()
Me._header = New DETBAEHeader()
Me._metaData = New DETBAEMetaData()
End Sub
Public Property MetaData() As DETBAEMetaData
Get
Return Me._metaData
End Get
Set
Me._metaData = Value
End Set
End Property
Public Property Header() As DETBAEHeader
Get
Return Me._header
End Get
Set
Me._header = Value
End Set
End Property
Public Property AuthorisedConsignee() As DETBAEAuthorisedConsignee
Get
Return Me._authorisedConsignee
End Get
Set
Me._authorisedConsignee = Value
End Set
End Property
Private Shared ReadOnly Property Serializer() As XmlSerializer
Get
If (sSerializer Is Nothing) Then
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAE))
End If
Return sSerializer
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serializes current DETBAE object into an XML string
'''
''' string XML value
Public Overridable Function Serialize() As String
Dim streamReader As System.IO.StreamReader = Nothing
Dim memoryStream As System.IO.MemoryStream = Nothing
Try
memoryStream = New System.IO.MemoryStream()
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
xmlWriterSettings.Indent = True
xmlWriterSettings.IndentChars = " "
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
Serializer.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream)
Return streamReader.ReadToEnd
Finally
If (Not (streamReader) Is Nothing) Then
streamReader.Dispose()
End If
If (Not (memoryStream) Is Nothing) Then
memoryStream.Dispose()
End If
End Try
End Function
'''
''' Deserializes workflow markup into an DETBAE object
'''
''' string workflow markup to deserialize
''' Output DETBAE 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 DETBAE, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAE)
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 DETBAE) 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 DETBAE
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAE)
Finally
If (Not (stringReader) Is Nothing) Then
stringReader.Dispose()
End If
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAE
Return CType(Serializer.Deserialize(s), DETBAE)
End Function
#End Region
'''
''' Serializes current DETBAE object into file
'''
''' full path of outupt xml file
''' output Exception value if failed
''' true if can serialize and save into file; otherwise, false
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName)
Return True
Catch e As System.Exception
exception = e
Return False
End Try
End Function
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim xmlString As String = Serialize()
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
streamWriter = xmlFile.CreateText
streamWriter.WriteLine(xmlString)
streamWriter.Close()
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose()
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an DETBAE object
'''
''' string xml file to load and deserialize
''' Output DETBAE 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 DETBAE, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAE)
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 DETBAE) 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 DETBAE
Dim file As System.IO.FileStream = Nothing
Dim sr As System.IO.StreamReader = Nothing
Try
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
sr = New System.IO.StreamReader(file)
Dim xmlString As String = sr.ReadToEnd
sr.Close()
file.Close()
Return Deserialize(xmlString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose()
End If
If (Not (sr) Is Nothing) Then
sr.Dispose()
End If
End Try
End Function
End Class
Partial Public Class DETBAEMetaData
#Region "Private fields"
Private _preparation As DETBAEMetaDataPreparation
Private _interchangeControlReference As String
Private _messageReferenceNumber As String
Private _messageIdentifier As String
Private _messageGroup As DETBAEMetaDataMessageGroup
Private _testIndicator As DETBAEMetaDataTestIndicator
Private _messageType As DETBAEMetaDataMessageType
Private _interchangeSender As DETBAEMetaDataInterchangeSender
Private _interchangeRecipient As DETBAEMetaDataInterchangeRecipient
Private Shared sSerializer As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._interchangeRecipient = New DETBAEMetaDataInterchangeRecipient()
Me._interchangeSender = New DETBAEMetaDataInterchangeSender()
Me._preparation = New DETBAEMetaDataPreparation()
End Sub
Public Property Preparation() As DETBAEMetaDataPreparation
Get
Return Me._preparation
End Get
Set
Me._preparation = Value
End Set
End Property
Public Property InterchangeControlReference() As String
Get
Return Me._interchangeControlReference
End Get
Set
Me._interchangeControlReference = Value
End Set
End Property
Public Property MessageReferenceNumber() As String
Get
Return Me._messageReferenceNumber
End Get
Set
Me._messageReferenceNumber = Value
End Set
End Property
Public Property MessageIdentifier() As String
Get
Return Me._messageIdentifier
End Get
Set
Me._messageIdentifier = Value
End Set
End Property
Public Property MessageGroup() As DETBAEMetaDataMessageGroup
Get
Return Me._messageGroup
End Get
Set
Me._messageGroup = Value
End Set
End Property
Public Property TestIndicator() As DETBAEMetaDataTestIndicator
Get
Return Me._testIndicator
End Get
Set
Me._testIndicator = Value
End Set
End Property
Public Property MessageType() As DETBAEMetaDataMessageType
Get
Return Me._messageType
End Get
Set
Me._messageType = Value
End Set
End Property
Public Property InterchangeSender() As DETBAEMetaDataInterchangeSender
Get
Return Me._interchangeSender
End Get
Set
Me._interchangeSender = Value
End Set
End Property
Public Property InterchangeRecipient() As DETBAEMetaDataInterchangeRecipient
Get
Return Me._interchangeRecipient
End Get
Set
Me._interchangeRecipient = Value
End Set
End Property
Private Shared ReadOnly Property Serializer() As XmlSerializer
Get
If (sSerializer Is Nothing) Then
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEMetaData))
End If
Return sSerializer
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serializes current DETBAEMetaData object into an XML string
'''
''' string XML value
Public Overridable Function Serialize() As String
Dim streamReader As System.IO.StreamReader = Nothing
Dim memoryStream As System.IO.MemoryStream = Nothing
Try
memoryStream = New System.IO.MemoryStream()
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
xmlWriterSettings.Indent = True
xmlWriterSettings.IndentChars = " "
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
Serializer.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream)
Return streamReader.ReadToEnd
Finally
If (Not (streamReader) Is Nothing) Then
streamReader.Dispose()
End If
If (Not (memoryStream) Is Nothing) Then
memoryStream.Dispose()
End If
End Try
End Function
'''
''' Deserializes workflow markup into an DETBAEMetaData object
'''
''' string workflow markup to deserialize
''' Output DETBAEMetaData 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 DETBAEMetaData, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEMetaData)
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 DETBAEMetaData) 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 DETBAEMetaData
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEMetaData)
Finally
If (Not (stringReader) Is Nothing) Then
stringReader.Dispose()
End If
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEMetaData
Return CType(Serializer.Deserialize(s), DETBAEMetaData)
End Function
#End Region
'''
''' Serializes current DETBAEMetaData object into file
'''
''' full path of outupt xml file
''' output Exception value if failed
''' true if can serialize and save into file; otherwise, false
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName)
Return True
Catch e As System.Exception
exception = e
Return False
End Try
End Function
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim xmlString As String = Serialize()
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
streamWriter = xmlFile.CreateText
streamWriter.WriteLine(xmlString)
streamWriter.Close()
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose()
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an DETBAEMetaData object
'''
''' string xml file to load and deserialize
''' Output DETBAEMetaData 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 DETBAEMetaData, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEMetaData)
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 DETBAEMetaData) 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 DETBAEMetaData
Dim file As System.IO.FileStream = Nothing
Dim sr As System.IO.StreamReader = Nothing
Try
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
sr = New System.IO.StreamReader(file)
Dim xmlString As String = sr.ReadToEnd
sr.Close()
file.Close()
Return Deserialize(xmlString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose()
End If
If (Not (sr) Is Nothing) Then
sr.Dispose()
End If
End Try
End Function
End Class
Partial Public Class DETBAEMetaDataPreparation
#Region "Private fields"
Private _date As Date
Private _time As Date
Private Shared sSerializer As XmlSerializer
#End Region
Public Property [Date]() As Date
Get
Return Me._date
End Get
Set
Me._date = Value
End Set
End Property
Public Property Time() As Date
Get
Return Me._time
End Get
Set
Me._time = Value
End Set
End Property
Private Shared ReadOnly Property Serializer() As XmlSerializer
Get
If (sSerializer Is Nothing) Then
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEMetaDataPreparation))
End If
Return sSerializer
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serializes current DETBAEMetaDataPreparation object into an XML string
'''
''' string XML value
Public Overridable Function Serialize() As String
Dim streamReader As System.IO.StreamReader = Nothing
Dim memoryStream As System.IO.MemoryStream = Nothing
Try
memoryStream = New System.IO.MemoryStream()
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
xmlWriterSettings.Indent = True
xmlWriterSettings.IndentChars = " "
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
Serializer.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream)
Return streamReader.ReadToEnd
Finally
If (Not (streamReader) Is Nothing) Then
streamReader.Dispose()
End If
If (Not (memoryStream) Is Nothing) Then
memoryStream.Dispose()
End If
End Try
End Function
'''
''' Deserializes workflow markup into an DETBAEMetaDataPreparation object
'''
''' string workflow markup to deserialize
''' Output DETBAEMetaDataPreparation 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 DETBAEMetaDataPreparation, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEMetaDataPreparation)
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 DETBAEMetaDataPreparation) 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 DETBAEMetaDataPreparation
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEMetaDataPreparation)
Finally
If (Not (stringReader) Is Nothing) Then
stringReader.Dispose()
End If
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEMetaDataPreparation
Return CType(Serializer.Deserialize(s), DETBAEMetaDataPreparation)
End Function
#End Region
'''
''' Serializes current DETBAEMetaDataPreparation object into file
'''
''' full path of outupt xml file
''' output Exception value if failed
''' true if can serialize and save into file; otherwise, false
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName)
Return True
Catch e As System.Exception
exception = e
Return False
End Try
End Function
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim xmlString As String = Serialize()
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
streamWriter = xmlFile.CreateText
streamWriter.WriteLine(xmlString)
streamWriter.Close()
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose()
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an DETBAEMetaDataPreparation object
'''
''' string xml file to load and deserialize
''' Output DETBAEMetaDataPreparation 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 DETBAEMetaDataPreparation, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEMetaDataPreparation)
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 DETBAEMetaDataPreparation) 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 DETBAEMetaDataPreparation
Dim file As System.IO.FileStream = Nothing
Dim sr As System.IO.StreamReader = Nothing
Try
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
sr = New System.IO.StreamReader(file)
Dim xmlString As String = sr.ReadToEnd
sr.Close()
file.Close()
Return Deserialize(xmlString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose()
End If
If (Not (sr) Is Nothing) Then
sr.Dispose()
End If
End Try
End Function
End Class
Public Enum DETBAEMetaDataMessageGroup
'''
TBE
End Enum
Public Enum DETBAEMetaDataTestIndicator
'''
Item1
End Enum
Public Enum DETBAEMetaDataMessageType
'''
DETBAE
End Enum
Partial Public Class DETBAEMetaDataInterchangeSender
#Region "Private fields"
Private _identification As DETBAEMetaDataInterchangeSenderIdentification
Private Shared sSerializer As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._identification = New DETBAEMetaDataInterchangeSenderIdentification()
End Sub
Public Property Identification() As DETBAEMetaDataInterchangeSenderIdentification
Get
Return Me._identification
End Get
Set
Me._identification = Value
End Set
End Property
Private Shared ReadOnly Property Serializer() As XmlSerializer
Get
If (sSerializer Is Nothing) Then
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEMetaDataInterchangeSender))
End If
Return sSerializer
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serializes current DETBAEMetaDataInterchangeSender object into an XML string
'''
''' string XML value
Public Overridable Function Serialize() As String
Dim streamReader As System.IO.StreamReader = Nothing
Dim memoryStream As System.IO.MemoryStream = Nothing
Try
memoryStream = New System.IO.MemoryStream()
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
xmlWriterSettings.Indent = True
xmlWriterSettings.IndentChars = " "
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
Serializer.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream)
Return streamReader.ReadToEnd
Finally
If (Not (streamReader) Is Nothing) Then
streamReader.Dispose()
End If
If (Not (memoryStream) Is Nothing) Then
memoryStream.Dispose()
End If
End Try
End Function
'''
''' Deserializes workflow markup into an DETBAEMetaDataInterchangeSender object
'''
''' string workflow markup to deserialize
''' Output DETBAEMetaDataInterchangeSender 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 DETBAEMetaDataInterchangeSender, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEMetaDataInterchangeSender)
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 DETBAEMetaDataInterchangeSender) 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 DETBAEMetaDataInterchangeSender
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEMetaDataInterchangeSender)
Finally
If (Not (stringReader) Is Nothing) Then
stringReader.Dispose()
End If
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEMetaDataInterchangeSender
Return CType(Serializer.Deserialize(s), DETBAEMetaDataInterchangeSender)
End Function
#End Region
'''
''' Serializes current DETBAEMetaDataInterchangeSender object into file
'''
''' full path of outupt xml file
''' output Exception value if failed
''' true if can serialize and save into file; otherwise, false
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName)
Return True
Catch e As System.Exception
exception = e
Return False
End Try
End Function
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim xmlString As String = Serialize()
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
streamWriter = xmlFile.CreateText
streamWriter.WriteLine(xmlString)
streamWriter.Close()
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose()
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an DETBAEMetaDataInterchangeSender object
'''
''' string xml file to load and deserialize
''' Output DETBAEMetaDataInterchangeSender 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 DETBAEMetaDataInterchangeSender, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEMetaDataInterchangeSender)
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 DETBAEMetaDataInterchangeSender) 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 DETBAEMetaDataInterchangeSender
Dim file As System.IO.FileStream = Nothing
Dim sr As System.IO.StreamReader = Nothing
Try
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
sr = New System.IO.StreamReader(file)
Dim xmlString As String = sr.ReadToEnd
sr.Close()
file.Close()
Return Deserialize(xmlString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose()
End If
If (Not (sr) Is Nothing) Then
sr.Dispose()
End If
End Try
End Function
End Class
Partial Public Class DETBAEMetaDataInterchangeSenderIdentification
#Region "Private fields"
Private _referenceNumber As String
Private _subsidiaryNumber As String
Private Shared sSerializer As XmlSerializer
#End Region
Public Property ReferenceNumber() As String
Get
Return Me._referenceNumber
End Get
Set
Me._referenceNumber = Value
End Set
End Property
Public Property SubsidiaryNumber() As String
Get
Return Me._subsidiaryNumber
End Get
Set
Me._subsidiaryNumber = Value
End Set
End Property
Private Shared ReadOnly Property Serializer() As XmlSerializer
Get
If (sSerializer Is Nothing) Then
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEMetaDataInterchangeSenderIdentification))
End If
Return sSerializer
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serializes current DETBAEMetaDataInterchangeSenderIdentification object into an XML string
'''
''' string XML value
Public Overridable Function Serialize() As String
Dim streamReader As System.IO.StreamReader = Nothing
Dim memoryStream As System.IO.MemoryStream = Nothing
Try
memoryStream = New System.IO.MemoryStream()
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
xmlWriterSettings.Indent = True
xmlWriterSettings.IndentChars = " "
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
Serializer.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream)
Return streamReader.ReadToEnd
Finally
If (Not (streamReader) Is Nothing) Then
streamReader.Dispose()
End If
If (Not (memoryStream) Is Nothing) Then
memoryStream.Dispose()
End If
End Try
End Function
'''
''' Deserializes workflow markup into an DETBAEMetaDataInterchangeSenderIdentification object
'''
''' string workflow markup to deserialize
''' Output DETBAEMetaDataInterchangeSenderIdentification 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 DETBAEMetaDataInterchangeSenderIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEMetaDataInterchangeSenderIdentification)
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 DETBAEMetaDataInterchangeSenderIdentification) 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 DETBAEMetaDataInterchangeSenderIdentification
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEMetaDataInterchangeSenderIdentification)
Finally
If (Not (stringReader) Is Nothing) Then
stringReader.Dispose()
End If
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEMetaDataInterchangeSenderIdentification
Return CType(Serializer.Deserialize(s), DETBAEMetaDataInterchangeSenderIdentification)
End Function
#End Region
'''
''' Serializes current DETBAEMetaDataInterchangeSenderIdentification object into file
'''
''' full path of outupt xml file
''' output Exception value if failed
''' true if can serialize and save into file; otherwise, false
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName)
Return True
Catch e As System.Exception
exception = e
Return False
End Try
End Function
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim xmlString As String = Serialize()
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
streamWriter = xmlFile.CreateText
streamWriter.WriteLine(xmlString)
streamWriter.Close()
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose()
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an DETBAEMetaDataInterchangeSenderIdentification object
'''
''' string xml file to load and deserialize
''' Output DETBAEMetaDataInterchangeSenderIdentification 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 DETBAEMetaDataInterchangeSenderIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEMetaDataInterchangeSenderIdentification)
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 DETBAEMetaDataInterchangeSenderIdentification) 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 DETBAEMetaDataInterchangeSenderIdentification
Dim file As System.IO.FileStream = Nothing
Dim sr As System.IO.StreamReader = Nothing
Try
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
sr = New System.IO.StreamReader(file)
Dim xmlString As String = sr.ReadToEnd
sr.Close()
file.Close()
Return Deserialize(xmlString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose()
End If
If (Not (sr) Is Nothing) Then
sr.Dispose()
End If
End Try
End Function
End Class
Partial Public Class DETBAEMetaDataInterchangeRecipient
#Region "Private fields"
Private _identification As DETBAEMetaDataInterchangeRecipientIdentification
Private Shared sSerializer As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._identification = New DETBAEMetaDataInterchangeRecipientIdentification()
End Sub
Public Property Identification() As DETBAEMetaDataInterchangeRecipientIdentification
Get
Return Me._identification
End Get
Set
Me._identification = Value
End Set
End Property
Private Shared ReadOnly Property Serializer() As XmlSerializer
Get
If (sSerializer Is Nothing) Then
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEMetaDataInterchangeRecipient))
End If
Return sSerializer
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serializes current DETBAEMetaDataInterchangeRecipient object into an XML string
'''
''' string XML value
Public Overridable Function Serialize() As String
Dim streamReader As System.IO.StreamReader = Nothing
Dim memoryStream As System.IO.MemoryStream = Nothing
Try
memoryStream = New System.IO.MemoryStream()
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
xmlWriterSettings.Indent = True
xmlWriterSettings.IndentChars = " "
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
Serializer.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream)
Return streamReader.ReadToEnd
Finally
If (Not (streamReader) Is Nothing) Then
streamReader.Dispose()
End If
If (Not (memoryStream) Is Nothing) Then
memoryStream.Dispose()
End If
End Try
End Function
'''
''' Deserializes workflow markup into an DETBAEMetaDataInterchangeRecipient object
'''
''' string workflow markup to deserialize
''' Output DETBAEMetaDataInterchangeRecipient 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 DETBAEMetaDataInterchangeRecipient, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEMetaDataInterchangeRecipient)
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 DETBAEMetaDataInterchangeRecipient) 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 DETBAEMetaDataInterchangeRecipient
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEMetaDataInterchangeRecipient)
Finally
If (Not (stringReader) Is Nothing) Then
stringReader.Dispose()
End If
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEMetaDataInterchangeRecipient
Return CType(Serializer.Deserialize(s), DETBAEMetaDataInterchangeRecipient)
End Function
#End Region
'''
''' Serializes current DETBAEMetaDataInterchangeRecipient object into file
'''
''' full path of outupt xml file
''' output Exception value if failed
''' true if can serialize and save into file; otherwise, false
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName)
Return True
Catch e As System.Exception
exception = e
Return False
End Try
End Function
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim xmlString As String = Serialize()
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
streamWriter = xmlFile.CreateText
streamWriter.WriteLine(xmlString)
streamWriter.Close()
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose()
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an DETBAEMetaDataInterchangeRecipient object
'''
''' string xml file to load and deserialize
''' Output DETBAEMetaDataInterchangeRecipient 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 DETBAEMetaDataInterchangeRecipient, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEMetaDataInterchangeRecipient)
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 DETBAEMetaDataInterchangeRecipient) 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 DETBAEMetaDataInterchangeRecipient
Dim file As System.IO.FileStream = Nothing
Dim sr As System.IO.StreamReader = Nothing
Try
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
sr = New System.IO.StreamReader(file)
Dim xmlString As String = sr.ReadToEnd
sr.Close()
file.Close()
Return Deserialize(xmlString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose()
End If
If (Not (sr) Is Nothing) Then
sr.Dispose()
End If
End Try
End Function
End Class
Partial Public Class DETBAEMetaDataInterchangeRecipientIdentification
#Region "Private fields"
Private _referenceNumber As String
Private Shared sSerializer As XmlSerializer
#End Region
Public Property ReferenceNumber() As String
Get
Return Me._referenceNumber
End Get
Set
Me._referenceNumber = Value
End Set
End Property
Private Shared ReadOnly Property Serializer() As XmlSerializer
Get
If (sSerializer Is Nothing) Then
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEMetaDataInterchangeRecipientIdentification))
End If
Return sSerializer
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serializes current DETBAEMetaDataInterchangeRecipientIdentification object into an XML string
'''
''' string XML value
Public Overridable Function Serialize() As String
Dim streamReader As System.IO.StreamReader = Nothing
Dim memoryStream As System.IO.MemoryStream = Nothing
Try
memoryStream = New System.IO.MemoryStream()
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
xmlWriterSettings.Indent = True
xmlWriterSettings.IndentChars = " "
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
Serializer.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream)
Return streamReader.ReadToEnd
Finally
If (Not (streamReader) Is Nothing) Then
streamReader.Dispose()
End If
If (Not (memoryStream) Is Nothing) Then
memoryStream.Dispose()
End If
End Try
End Function
'''
''' Deserializes workflow markup into an DETBAEMetaDataInterchangeRecipientIdentification object
'''
''' string workflow markup to deserialize
''' Output DETBAEMetaDataInterchangeRecipientIdentification 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 DETBAEMetaDataInterchangeRecipientIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEMetaDataInterchangeRecipientIdentification)
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 DETBAEMetaDataInterchangeRecipientIdentification) 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 DETBAEMetaDataInterchangeRecipientIdentification
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEMetaDataInterchangeRecipientIdentification)
Finally
If (Not (stringReader) Is Nothing) Then
stringReader.Dispose()
End If
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEMetaDataInterchangeRecipientIdentification
Return CType(Serializer.Deserialize(s), DETBAEMetaDataInterchangeRecipientIdentification)
End Function
#End Region
'''
''' Serializes current DETBAEMetaDataInterchangeRecipientIdentification object into file
'''
''' full path of outupt xml file
''' output Exception value if failed
''' true if can serialize and save into file; otherwise, false
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName)
Return True
Catch e As System.Exception
exception = e
Return False
End Try
End Function
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim xmlString As String = Serialize()
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
streamWriter = xmlFile.CreateText
streamWriter.WriteLine(xmlString)
streamWriter.Close()
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose()
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an DETBAEMetaDataInterchangeRecipientIdentification object
'''
''' string xml file to load and deserialize
''' Output DETBAEMetaDataInterchangeRecipientIdentification 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 DETBAEMetaDataInterchangeRecipientIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEMetaDataInterchangeRecipientIdentification)
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 DETBAEMetaDataInterchangeRecipientIdentification) 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 DETBAEMetaDataInterchangeRecipientIdentification
Dim file As System.IO.FileStream = Nothing
Dim sr As System.IO.StreamReader = Nothing
Try
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
sr = New System.IO.StreamReader(file)
Dim xmlString As String = sr.ReadToEnd
sr.Close()
file.Close()
Return Deserialize(xmlString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose()
End If
If (Not (sr) Is Nothing) Then
sr.Dispose()
End If
End Try
End Function
End Class
Partial Public Class DETBAEHeader
#Region "Private fields"
Private _messageVersion As String
Private _referenceNumber As String
Private _presentationDate As Date
Private _eventFlag As String
Private _deliveryPlace As String
Private _customsAuthorisation As DETBAEHeaderCustomsAuthorisation
Private _authorisationNumber As String
Private Shared sSerializer As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._customsAuthorisation = New DETBAEHeaderCustomsAuthorisation()
End Sub
Public Property MessageVersion() As String
Get
Return Me._messageVersion
End Get
Set
Me._messageVersion = Value
End Set
End Property
Public Property ReferenceNumber() As String
Get
Return Me._referenceNumber
End Get
Set
Me._referenceNumber = Value
End Set
End Property
Public Property PresentationDate() As Date
Get
Return Me._presentationDate
End Get
Set
Me._presentationDate = Value
End Set
End Property
Public Property EventFlag() As String
Get
Return Me._eventFlag
End Get
Set
Me._eventFlag = Value
End Set
End Property
Public Property DeliveryPlace() As String
Get
Return Me._deliveryPlace
End Get
Set
Me._deliveryPlace = Value
End Set
End Property
Public Property CustomsAuthorisation() As DETBAEHeaderCustomsAuthorisation
Get
Return Me._customsAuthorisation
End Get
Set
Me._customsAuthorisation = Value
End Set
End Property
Public Property AuthorisationNumber() As String
Get
Return Me._authorisationNumber
End Get
Set
Me._authorisationNumber = Value
End Set
End Property
Private Shared ReadOnly Property Serializer() As XmlSerializer
Get
If (sSerializer Is Nothing) Then
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEHeader))
End If
Return sSerializer
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serializes current DETBAEHeader object into an XML string
'''
''' string XML value
Public Overridable Function Serialize() As String
Dim streamReader As System.IO.StreamReader = Nothing
Dim memoryStream As System.IO.MemoryStream = Nothing
Try
memoryStream = New System.IO.MemoryStream()
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
xmlWriterSettings.Indent = True
xmlWriterSettings.IndentChars = " "
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
Serializer.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream)
Return streamReader.ReadToEnd
Finally
If (Not (streamReader) Is Nothing) Then
streamReader.Dispose()
End If
If (Not (memoryStream) Is Nothing) Then
memoryStream.Dispose()
End If
End Try
End Function
'''
''' Deserializes workflow markup into an DETBAEHeader object
'''
''' string workflow markup to deserialize
''' Output DETBAEHeader 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 DETBAEHeader, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEHeader)
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 DETBAEHeader) 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 DETBAEHeader
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEHeader)
Finally
If (Not (stringReader) Is Nothing) Then
stringReader.Dispose()
End If
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEHeader
Return CType(Serializer.Deserialize(s), DETBAEHeader)
End Function
#End Region
'''
''' Serializes current DETBAEHeader object into file
'''
''' full path of outupt xml file
''' output Exception value if failed
''' true if can serialize and save into file; otherwise, false
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName)
Return True
Catch e As System.Exception
exception = e
Return False
End Try
End Function
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim xmlString As String = Serialize()
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
streamWriter = xmlFile.CreateText
streamWriter.WriteLine(xmlString)
streamWriter.Close()
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose()
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an DETBAEHeader object
'''
''' string xml file to load and deserialize
''' Output DETBAEHeader 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 DETBAEHeader, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEHeader)
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 DETBAEHeader) 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 DETBAEHeader
Dim file As System.IO.FileStream = Nothing
Dim sr As System.IO.StreamReader = Nothing
Try
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
sr = New System.IO.StreamReader(file)
Dim xmlString As String = sr.ReadToEnd
sr.Close()
file.Close()
Return Deserialize(xmlString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose()
End If
If (Not (sr) Is Nothing) Then
sr.Dispose()
End If
End Try
End Function
End Class
Partial Public Class DETBAEHeaderCustomsAuthorisation
#Region "Private fields"
Private _currentProcedure As String
Private Shared sSerializer As XmlSerializer
#End Region
Public Property CurrentProcedure() As String
Get
Return Me._currentProcedure
End Get
Set
Me._currentProcedure = Value
End Set
End Property
Private Shared ReadOnly Property Serializer() As XmlSerializer
Get
If (sSerializer Is Nothing) Then
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEHeaderCustomsAuthorisation))
End If
Return sSerializer
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serializes current DETBAEHeaderCustomsAuthorisation object into an XML string
'''
''' string XML value
Public Overridable Function Serialize() As String
Dim streamReader As System.IO.StreamReader = Nothing
Dim memoryStream As System.IO.MemoryStream = Nothing
Try
memoryStream = New System.IO.MemoryStream()
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
xmlWriterSettings.Indent = True
xmlWriterSettings.IndentChars = " "
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
Serializer.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream)
Return streamReader.ReadToEnd
Finally
If (Not (streamReader) Is Nothing) Then
streamReader.Dispose()
End If
If (Not (memoryStream) Is Nothing) Then
memoryStream.Dispose()
End If
End Try
End Function
'''
''' Deserializes workflow markup into an DETBAEHeaderCustomsAuthorisation object
'''
''' string workflow markup to deserialize
''' Output DETBAEHeaderCustomsAuthorisation 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 DETBAEHeaderCustomsAuthorisation, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEHeaderCustomsAuthorisation)
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 DETBAEHeaderCustomsAuthorisation) 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 DETBAEHeaderCustomsAuthorisation
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEHeaderCustomsAuthorisation)
Finally
If (Not (stringReader) Is Nothing) Then
stringReader.Dispose()
End If
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEHeaderCustomsAuthorisation
Return CType(Serializer.Deserialize(s), DETBAEHeaderCustomsAuthorisation)
End Function
#End Region
'''
''' Serializes current DETBAEHeaderCustomsAuthorisation object into file
'''
''' full path of outupt xml file
''' output Exception value if failed
''' true if can serialize and save into file; otherwise, false
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName)
Return True
Catch e As System.Exception
exception = e
Return False
End Try
End Function
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim xmlString As String = Serialize()
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
streamWriter = xmlFile.CreateText
streamWriter.WriteLine(xmlString)
streamWriter.Close()
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose()
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an DETBAEHeaderCustomsAuthorisation object
'''
''' string xml file to load and deserialize
''' Output DETBAEHeaderCustomsAuthorisation 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 DETBAEHeaderCustomsAuthorisation, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEHeaderCustomsAuthorisation)
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 DETBAEHeaderCustomsAuthorisation) 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 DETBAEHeaderCustomsAuthorisation
Dim file As System.IO.FileStream = Nothing
Dim sr As System.IO.StreamReader = Nothing
Try
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
sr = New System.IO.StreamReader(file)
Dim xmlString As String = sr.ReadToEnd
sr.Close()
file.Close()
Return Deserialize(xmlString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose()
End If
If (Not (sr) Is Nothing) Then
sr.Dispose()
End If
End Try
End Function
End Class
Partial Public Class DETBAEAuthorisedConsignee
#Region "Private fields"
Private _class As DETBAEAuthorisedConsigneeClass
Private _identification As DETBAEAuthorisedConsigneeIdentification
Private _contactPerson As DETBAEAuthorisedConsigneeContactPerson
Private Shared sSerializer As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._contactPerson = New DETBAEAuthorisedConsigneeContactPerson()
Me._identification = New DETBAEAuthorisedConsigneeIdentification()
End Sub
Public Property [Class]() As DETBAEAuthorisedConsigneeClass
Get
Return Me._class
End Get
Set
Me._class = Value
End Set
End Property
Public Property Identification() As DETBAEAuthorisedConsigneeIdentification
Get
Return Me._identification
End Get
Set
Me._identification = Value
End Set
End Property
Public Property ContactPerson() As DETBAEAuthorisedConsigneeContactPerson
Get
Return Me._contactPerson
End Get
Set
Me._contactPerson = Value
End Set
End Property
Private Shared ReadOnly Property Serializer() As XmlSerializer
Get
If (sSerializer Is Nothing) Then
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEAuthorisedConsignee))
End If
Return sSerializer
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serializes current DETBAEAuthorisedConsignee object into an XML string
'''
''' string XML value
Public Overridable Function Serialize() As String
Dim streamReader As System.IO.StreamReader = Nothing
Dim memoryStream As System.IO.MemoryStream = Nothing
Try
memoryStream = New System.IO.MemoryStream()
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
xmlWriterSettings.Indent = True
xmlWriterSettings.IndentChars = " "
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
Serializer.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream)
Return streamReader.ReadToEnd
Finally
If (Not (streamReader) Is Nothing) Then
streamReader.Dispose()
End If
If (Not (memoryStream) Is Nothing) Then
memoryStream.Dispose()
End If
End Try
End Function
'''
''' Deserializes workflow markup into an DETBAEAuthorisedConsignee object
'''
''' string workflow markup to deserialize
''' Output DETBAEAuthorisedConsignee 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 DETBAEAuthorisedConsignee, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEAuthorisedConsignee)
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 DETBAEAuthorisedConsignee) 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 DETBAEAuthorisedConsignee
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEAuthorisedConsignee)
Finally
If (Not (stringReader) Is Nothing) Then
stringReader.Dispose()
End If
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEAuthorisedConsignee
Return CType(Serializer.Deserialize(s), DETBAEAuthorisedConsignee)
End Function
#End Region
'''
''' Serializes current DETBAEAuthorisedConsignee object into file
'''
''' full path of outupt xml file
''' output Exception value if failed
''' true if can serialize and save into file; otherwise, false
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName)
Return True
Catch e As System.Exception
exception = e
Return False
End Try
End Function
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim xmlString As String = Serialize()
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
streamWriter = xmlFile.CreateText
streamWriter.WriteLine(xmlString)
streamWriter.Close()
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose()
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an DETBAEAuthorisedConsignee object
'''
''' string xml file to load and deserialize
''' Output DETBAEAuthorisedConsignee 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 DETBAEAuthorisedConsignee, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEAuthorisedConsignee)
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 DETBAEAuthorisedConsignee) 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 DETBAEAuthorisedConsignee
Dim file As System.IO.FileStream = Nothing
Dim sr As System.IO.StreamReader = Nothing
Try
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
sr = New System.IO.StreamReader(file)
Dim xmlString As String = sr.ReadToEnd
sr.Close()
file.Close()
Return Deserialize(xmlString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose()
End If
If (Not (sr) Is Nothing) Then
sr.Dispose()
End If
End Try
End Function
End Class
Public Enum DETBAEAuthorisedConsigneeClass
'''
Item2
End Enum
Partial Public Class DETBAEAuthorisedConsigneeIdentification
#Region "Private fields"
Private _referenceNumber As String
Private _subsidiaryNumber As String
Private Shared sSerializer As XmlSerializer
#End Region
Public Property ReferenceNumber() As String
Get
Return Me._referenceNumber
End Get
Set
Me._referenceNumber = Value
End Set
End Property
Public Property SubsidiaryNumber() As String
Get
Return Me._subsidiaryNumber
End Get
Set
Me._subsidiaryNumber = Value
End Set
End Property
Private Shared ReadOnly Property Serializer() As XmlSerializer
Get
If (sSerializer Is Nothing) Then
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEAuthorisedConsigneeIdentification))
End If
Return sSerializer
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serializes current DETBAEAuthorisedConsigneeIdentification object into an XML string
'''
''' string XML value
Public Overridable Function Serialize() As String
Dim streamReader As System.IO.StreamReader = Nothing
Dim memoryStream As System.IO.MemoryStream = Nothing
Try
memoryStream = New System.IO.MemoryStream()
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
xmlWriterSettings.Indent = True
xmlWriterSettings.IndentChars = " "
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
Serializer.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream)
Return streamReader.ReadToEnd
Finally
If (Not (streamReader) Is Nothing) Then
streamReader.Dispose()
End If
If (Not (memoryStream) Is Nothing) Then
memoryStream.Dispose()
End If
End Try
End Function
'''
''' Deserializes workflow markup into an DETBAEAuthorisedConsigneeIdentification object
'''
''' string workflow markup to deserialize
''' Output DETBAEAuthorisedConsigneeIdentification 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 DETBAEAuthorisedConsigneeIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEAuthorisedConsigneeIdentification)
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 DETBAEAuthorisedConsigneeIdentification) 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 DETBAEAuthorisedConsigneeIdentification
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEAuthorisedConsigneeIdentification)
Finally
If (Not (stringReader) Is Nothing) Then
stringReader.Dispose()
End If
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEAuthorisedConsigneeIdentification
Return CType(Serializer.Deserialize(s), DETBAEAuthorisedConsigneeIdentification)
End Function
#End Region
'''
''' Serializes current DETBAEAuthorisedConsigneeIdentification object into file
'''
''' full path of outupt xml file
''' output Exception value if failed
''' true if can serialize and save into file; otherwise, false
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName)
Return True
Catch e As System.Exception
exception = e
Return False
End Try
End Function
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim xmlString As String = Serialize()
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
streamWriter = xmlFile.CreateText
streamWriter.WriteLine(xmlString)
streamWriter.Close()
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose()
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an DETBAEAuthorisedConsigneeIdentification object
'''
''' string xml file to load and deserialize
''' Output DETBAEAuthorisedConsigneeIdentification 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 DETBAEAuthorisedConsigneeIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEAuthorisedConsigneeIdentification)
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 DETBAEAuthorisedConsigneeIdentification) 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 DETBAEAuthorisedConsigneeIdentification
Dim file As System.IO.FileStream = Nothing
Dim sr As System.IO.StreamReader = Nothing
Try
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
sr = New System.IO.StreamReader(file)
Dim xmlString As String = sr.ReadToEnd
sr.Close()
file.Close()
Return Deserialize(xmlString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose()
End If
If (Not (sr) Is Nothing) Then
sr.Dispose()
End If
End Try
End Function
End Class
Partial Public Class DETBAEAuthorisedConsigneeContactPerson
#Region "Private fields"
Private _name As String
Private _position As String
Private _phoneNumber As String
Private _facsimileNumber As String
Private _mailAddress As String
Private Shared sSerializer As XmlSerializer
#End Region
Public Property Name() As String
Get
Return Me._name
End Get
Set
Me._name = Value
End Set
End Property
Public Property Position() As String
Get
Return Me._position
End Get
Set
Me._position = Value
End Set
End Property
Public Property PhoneNumber() As String
Get
Return Me._phoneNumber
End Get
Set
Me._phoneNumber = Value
End Set
End Property
Public Property FacsimileNumber() As String
Get
Return Me._facsimileNumber
End Get
Set
Me._facsimileNumber = Value
End Set
End Property
Public Property MailAddress() As String
Get
Return Me._mailAddress
End Get
Set
Me._mailAddress = Value
End Set
End Property
Private Shared ReadOnly Property Serializer() As XmlSerializer
Get
If (sSerializer Is Nothing) Then
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEAuthorisedConsigneeContactPerson))
End If
Return sSerializer
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serializes current DETBAEAuthorisedConsigneeContactPerson object into an XML string
'''
''' string XML value
Public Overridable Function Serialize() As String
Dim streamReader As System.IO.StreamReader = Nothing
Dim memoryStream As System.IO.MemoryStream = Nothing
Try
memoryStream = New System.IO.MemoryStream()
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
xmlWriterSettings.Indent = True
xmlWriterSettings.IndentChars = " "
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
Serializer.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream)
Return streamReader.ReadToEnd
Finally
If (Not (streamReader) Is Nothing) Then
streamReader.Dispose()
End If
If (Not (memoryStream) Is Nothing) Then
memoryStream.Dispose()
End If
End Try
End Function
'''
''' Deserializes workflow markup into an DETBAEAuthorisedConsigneeContactPerson object
'''
''' string workflow markup to deserialize
''' Output DETBAEAuthorisedConsigneeContactPerson 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 DETBAEAuthorisedConsigneeContactPerson, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEAuthorisedConsigneeContactPerson)
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 DETBAEAuthorisedConsigneeContactPerson) 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 DETBAEAuthorisedConsigneeContactPerson
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEAuthorisedConsigneeContactPerson)
Finally
If (Not (stringReader) Is Nothing) Then
stringReader.Dispose()
End If
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEAuthorisedConsigneeContactPerson
Return CType(Serializer.Deserialize(s), DETBAEAuthorisedConsigneeContactPerson)
End Function
#End Region
'''
''' Serializes current DETBAEAuthorisedConsigneeContactPerson object into file
'''
''' full path of outupt xml file
''' output Exception value if failed
''' true if can serialize and save into file; otherwise, false
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName)
Return True
Catch e As System.Exception
exception = e
Return False
End Try
End Function
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim xmlString As String = Serialize()
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
streamWriter = xmlFile.CreateText
streamWriter.WriteLine(xmlString)
streamWriter.Close()
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose()
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an DETBAEAuthorisedConsigneeContactPerson object
'''
''' string xml file to load and deserialize
''' Output DETBAEAuthorisedConsigneeContactPerson 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 DETBAEAuthorisedConsigneeContactPerson, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, DETBAEAuthorisedConsigneeContactPerson)
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 DETBAEAuthorisedConsigneeContactPerson) 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 DETBAEAuthorisedConsigneeContactPerson
Dim file As System.IO.FileStream = Nothing
Dim sr As System.IO.StreamReader = Nothing
Try
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
sr = New System.IO.StreamReader(file)
Dim xmlString As String = sr.ReadToEnd
sr.Close()
file.Close()
Return Deserialize(xmlString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose()
End If
If (Not (sr) Is Nothing) Then
sr.Dispose()
End If
End Try
End Function
End Class
Partial Public Class [decimal]
#Region "Private fields"
Private _anyAttr As List(Of System.Xml.XmlAttribute)
Private _value As Decimal
Private Shared sSerializer As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._anyAttr = New List(Of System.Xml.XmlAttribute)()
End Sub
Public Property AnyAttr() As List(Of System.Xml.XmlAttribute)
Get
Return Me._anyAttr
End Get
Set
Me._anyAttr = Value
End Set
End Property
Public Property Value() As Decimal
Get
Return Me._value
End Get
Set
Me._value = Value
End Set
End Property
Private Shared ReadOnly Property Serializer() As XmlSerializer
Get
If (sSerializer Is Nothing) Then
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType([decimal]))
End If
Return sSerializer
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serializes current decimal object into an XML string
'''
''' string XML value
Public Overridable Function Serialize() As String
Dim streamReader As System.IO.StreamReader = Nothing
Dim memoryStream As System.IO.MemoryStream = Nothing
Try
memoryStream = New System.IO.MemoryStream()
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
xmlWriterSettings.Indent = True
xmlWriterSettings.IndentChars = " "
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
Serializer.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream)
Return streamReader.ReadToEnd
Finally
If (Not (streamReader) Is Nothing) Then
streamReader.Dispose()
End If
If (Not (memoryStream) Is Nothing) Then
memoryStream.Dispose()
End If
End Try
End Function
'''
''' Deserializes workflow markup into an decimal object
'''
''' string workflow markup to deserialize
''' Output decimal object
''' output Exception value if deserialize failed
''' true if this Serializer can deserialize the object; otherwise, false
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As [decimal], ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, [decimal])
Try
obj = Deserialize(input)
Return True
Catch ex As System.Exception
exception = ex
Return False
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As [decimal]) As Boolean
Dim exception As System.Exception = Nothing
Return Deserialize(input, obj, exception)
End Function
Public Overloads Shared Function Deserialize(ByVal input As String) As [decimal]
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), [decimal])
Finally
If (Not (stringReader) Is Nothing) Then
stringReader.Dispose()
End If
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As [decimal]
Return CType(Serializer.Deserialize(s), [decimal])
End Function
#End Region
'''
''' Serializes current decimal object into file
'''
''' full path of outupt xml file
''' output Exception value if failed
''' true if can serialize and save into file; otherwise, false
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName)
Return True
Catch e As System.Exception
exception = e
Return False
End Try
End Function
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim xmlString As String = Serialize()
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
streamWriter = xmlFile.CreateText
streamWriter.WriteLine(xmlString)
streamWriter.Close()
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose()
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an decimal object
'''
''' string xml file to load and deserialize
''' Output decimal object
''' output Exception value if deserialize failed
''' true if this Serializer can deserialize the object; otherwise, false
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As [decimal], ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, [decimal])
Try
obj = LoadFromFile(fileName)
Return True
Catch ex As System.Exception
exception = ex
Return False
End Try
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As [decimal]) As Boolean
Dim exception As System.Exception = Nothing
Return LoadFromFile(fileName, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As [decimal]
Dim file As System.IO.FileStream = Nothing
Dim sr As System.IO.StreamReader = Nothing
Try
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
sr = New System.IO.StreamReader(file)
Dim xmlString As String = sr.ReadToEnd
sr.Close()
file.Close()
Return Deserialize(xmlString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose()
End If
If (Not (sr) Is Nothing) Then
sr.Dispose()
End If
End Try
End Function
End Class
Partial Public Class [integer]
#Region "Private fields"
Private _anyAttr As List(Of System.Xml.XmlAttribute)
Private _value As String
Private Shared sSerializer As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._anyAttr = New List(Of System.Xml.XmlAttribute)()
End Sub
Public Property AnyAttr() As List(Of System.Xml.XmlAttribute)
Get
Return Me._anyAttr
End Get
Set
Me._anyAttr = 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 Serializer() As XmlSerializer
Get
If (sSerializer Is Nothing) Then
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType([integer]))
End If
Return sSerializer
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serializes current integer object into an XML string
'''
''' string XML value
Public Overridable Function Serialize() As String
Dim streamReader As System.IO.StreamReader = Nothing
Dim memoryStream As System.IO.MemoryStream = Nothing
Try
memoryStream = New System.IO.MemoryStream()
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
xmlWriterSettings.Indent = True
xmlWriterSettings.IndentChars = " "
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
Serializer.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream)
Return streamReader.ReadToEnd
Finally
If (Not (streamReader) Is Nothing) Then
streamReader.Dispose()
End If
If (Not (memoryStream) Is Nothing) Then
memoryStream.Dispose()
End If
End Try
End Function
'''
''' Deserializes workflow markup into an integer object
'''
''' string workflow markup to deserialize
''' Output integer object
''' output Exception value if deserialize failed
''' true if this Serializer can deserialize the object; otherwise, false
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As [integer], ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, [integer])
Try
obj = Deserialize(input)
Return True
Catch ex As System.Exception
exception = ex
Return False
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As [integer]) As Boolean
Dim exception As System.Exception = Nothing
Return Deserialize(input, obj, exception)
End Function
Public Overloads Shared Function Deserialize(ByVal input As String) As [integer]
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), [integer])
Finally
If (Not (stringReader) Is Nothing) Then
stringReader.Dispose()
End If
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As [integer]
Return CType(Serializer.Deserialize(s), [integer])
End Function
#End Region
'''
''' Serializes current integer object into file
'''
''' full path of outupt xml file
''' output Exception value if failed
''' true if can serialize and save into file; otherwise, false
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName)
Return True
Catch e As System.Exception
exception = e
Return False
End Try
End Function
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim xmlString As String = Serialize()
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
streamWriter = xmlFile.CreateText
streamWriter.WriteLine(xmlString)
streamWriter.Close()
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose()
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an integer object
'''
''' string xml file to load and deserialize
''' Output integer object
''' output Exception value if deserialize failed
''' true if this Serializer can deserialize the object; otherwise, false
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As [integer], ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, [integer])
Try
obj = LoadFromFile(fileName)
Return True
Catch ex As System.Exception
exception = ex
Return False
End Try
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As [integer]) As Boolean
Dim exception As System.Exception = Nothing
Return LoadFromFile(fileName, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As [integer]
Dim file As System.IO.FileStream = Nothing
Dim sr As System.IO.StreamReader = Nothing
Try
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
sr = New System.IO.StreamReader(file)
Dim xmlString As String = sr.ReadToEnd
sr.Close()
file.Close()
Return Deserialize(xmlString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose()
End If
If (Not (sr) Is Nothing) Then
sr.Dispose()
End If
End Try
End Function
End Class
Partial Public Class token
#Region "Private fields"
Private _anyAttr As List(Of System.Xml.XmlAttribute)
Private _value As String
Private Shared sSerializer As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._anyAttr = New List(Of System.Xml.XmlAttribute)()
End Sub
Public Property AnyAttr() As List(Of System.Xml.XmlAttribute)
Get
Return Me._anyAttr
End Get
Set
Me._anyAttr = 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 Serializer() As XmlSerializer
Get
If (sSerializer Is Nothing) Then
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(token))
End If
Return sSerializer
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serializes current token object into an XML string
'''
''' string XML value
Public Overridable Function Serialize() As String
Dim streamReader As System.IO.StreamReader = Nothing
Dim memoryStream As System.IO.MemoryStream = Nothing
Try
memoryStream = New System.IO.MemoryStream()
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
xmlWriterSettings.Indent = True
xmlWriterSettings.IndentChars = " "
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
Serializer.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream)
Return streamReader.ReadToEnd
Finally
If (Not (streamReader) Is Nothing) Then
streamReader.Dispose()
End If
If (Not (memoryStream) Is Nothing) Then
memoryStream.Dispose()
End If
End Try
End Function
'''
''' Deserializes workflow markup into an token object
'''
''' string workflow markup to deserialize
''' Output token object
''' output Exception value if deserialize failed
''' true if this Serializer can deserialize the object; otherwise, false
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As token, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, token)
Try
obj = Deserialize(input)
Return True
Catch ex As System.Exception
exception = ex
Return False
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As token) As Boolean
Dim exception As System.Exception = Nothing
Return Deserialize(input, obj, exception)
End Function
Public Overloads Shared Function Deserialize(ByVal input As String) As token
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), token)
Finally
If (Not (stringReader) Is Nothing) Then
stringReader.Dispose()
End If
End Try
End Function
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As token
Return CType(Serializer.Deserialize(s), token)
End Function
#End Region
'''
''' Serializes current token object into file
'''
''' full path of outupt xml file
''' output Exception value if failed
''' true if can serialize and save into file; otherwise, false
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName)
Return True
Catch e As System.Exception
exception = e
Return False
End Try
End Function
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim xmlString As String = Serialize()
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
streamWriter = xmlFile.CreateText
streamWriter.WriteLine(xmlString)
streamWriter.Close()
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose()
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an token object
'''
''' string xml file to load and deserialize
''' Output token object
''' output Exception value if deserialize failed
''' true if this Serializer can deserialize the object; otherwise, false
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As token, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, token)
Try
obj = LoadFromFile(fileName)
Return True
Catch ex As System.Exception
exception = ex
Return False
End Try
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As token) As Boolean
Dim exception As System.Exception = Nothing
Return LoadFromFile(fileName, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As token
Dim file As System.IO.FileStream = Nothing
Dim sr As System.IO.StreamReader = Nothing
Try
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
sr = New System.IO.StreamReader(file)
Dim xmlString As String = sr.ReadToEnd
sr.Close()
file.Close()
Return Deserialize(xmlString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose()
End If
If (Not (sr) Is Nothing) Then
sr.Dispose()
End If
End Try
End Function
End Class
End Namespace