'' ------------------------------------------------------------------------------
''
'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com
'' {"TargetFramework":"Net20","NameSpace":"FCFCDF","Language":"VisualBasic","CollectionBase":"","Properties":{"PrivateFieldCustomPrefix":""},"XmlAttribute":{"Enabled":true,"GenerateOrderXmlAttributes":true},"ClassParams":{"GenerateInSeparateFilesDirectory":""},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{"IndentChars":"Indent1Space"},"JsonOutput":{},"Enabled":true,"EnableEncoding":true},"Miscellaneous":{"CleanupCode":false}}
''
'' ------------------------------------------------------------------------------
#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 FCFCDF
_
Partial Public Class FCFCDF
#Region "Private fields"
Private _metaData As FCFCDFMetaData
Private _header As FCFCDFHeader
Private _declarant As FCFCDFDeclarant
Private _representative As FCFCDFRepresentative
Private _principal As FCFCDFPrincipal
Private _contactPerson As FCFCDFContactPerson
Private _dutyDefermentApproval As List(Of FCFCDFDutyDefermentApproval)
Private _borderTransportMeans As FCFCDFBorderTransportMeans
Private _arrivalTransportMeans As FCFCDFArrivalTransportMeans
Private _previousAdministrativeReferences As FCFCDFPreviousAdministrativeReferences
Private _summaryDeclaration As FCFCDFSummaryDeclaration
Private _customsWarehouse As FCFCDFCustomsWarehouse
Private _inwardProcessing As FCFCDFInwardProcessing
Private _body As FCFCDFBody
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._body = New FCFCDFBody()
Me._inwardProcessing = New FCFCDFInwardProcessing()
Me._customsWarehouse = New FCFCDFCustomsWarehouse()
Me._summaryDeclaration = New FCFCDFSummaryDeclaration()
Me._previousAdministrativeReferences = New FCFCDFPreviousAdministrativeReferences()
Me._arrivalTransportMeans = New FCFCDFArrivalTransportMeans()
Me._borderTransportMeans = New FCFCDFBorderTransportMeans()
Me._dutyDefermentApproval = New List(Of FCFCDFDutyDefermentApproval)()
Me._contactPerson = New FCFCDFContactPerson()
Me._principal = New FCFCDFPrincipal()
Me._representative = New FCFCDFRepresentative()
Me._declarant = New FCFCDFDeclarant()
Me._header = New FCFCDFHeader()
Me._metaData = New FCFCDFMetaData()
End Sub
_
Public Property MetaData() As FCFCDFMetaData
Get
Return Me._metaData
End Get
Set
Me._metaData = value
End Set
End Property
_
Public Property Header() As FCFCDFHeader
Get
Return Me._header
End Get
Set
Me._header = value
End Set
End Property
_
Public Property Declarant() As FCFCDFDeclarant
Get
Return Me._declarant
End Get
Set
Me._declarant = value
End Set
End Property
_
Public Property Representative() As FCFCDFRepresentative
Get
Return Me._representative
End Get
Set
Me._representative = value
End Set
End Property
_
Public Property Principal() As FCFCDFPrincipal
Get
Return Me._principal
End Get
Set
Me._principal = value
End Set
End Property
_
Public Property ContactPerson() As FCFCDFContactPerson
Get
Return Me._contactPerson
End Get
Set
Me._contactPerson = value
End Set
End Property
_
Public Property DutyDefermentApproval() As List(Of FCFCDFDutyDefermentApproval)
Get
Return Me._dutyDefermentApproval
End Get
Set
Me._dutyDefermentApproval = value
End Set
End Property
_
Public Property BorderTransportMeans() As FCFCDFBorderTransportMeans
Get
Return Me._borderTransportMeans
End Get
Set
Me._borderTransportMeans = value
End Set
End Property
_
Public Property ArrivalTransportMeans() As FCFCDFArrivalTransportMeans
Get
Return Me._arrivalTransportMeans
End Get
Set
Me._arrivalTransportMeans = value
End Set
End Property
_
Public Property PreviousAdministrativeReferences() As FCFCDFPreviousAdministrativeReferences
Get
Return Me._previousAdministrativeReferences
End Get
Set
Me._previousAdministrativeReferences = value
End Set
End Property
_
Public Property SummaryDeclaration() As FCFCDFSummaryDeclaration
Get
Return Me._summaryDeclaration
End Get
Set
Me._summaryDeclaration = value
End Set
End Property
_
Public Property CustomsWarehouse() As FCFCDFCustomsWarehouse
Get
Return Me._customsWarehouse
End Get
Set
Me._customsWarehouse = value
End Set
End Property
_
Public Property InwardProcessing() As FCFCDFInwardProcessing
Get
Return Me._inwardProcessing
End Get
Set
Me._inwardProcessing = value
End Set
End Property
_
Public Property Body() As FCFCDFBody
Get
Return Me._body
End Get
Set
Me._body = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDF))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDF object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDF object
'''
''' string to deserialize
''' Output FCFCDF 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 FCFCDF, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDF)
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 FCFCDF) 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 FCFCDF
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDF)
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 FCFCDF
Return CType(SerializerXml.Deserialize(s),FCFCDF)
End Function
#End Region
'''
''' Serializes current FCFCDF 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDF object
'''
''' File to load and deserialize
''' Output FCFCDF 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDF, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDF)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDF, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDF) 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 FCFCDF
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDF
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFMetaData
#Region "Private fields"
Private _preparation As FCFCDFMetaDataPreparation
Private _interchangeControlReference As String
Private _messageReferenceNumber As String
Private _messageIdentifier As String
Private _messageGroup As FCFCDFMetaDataMessageGroup
Private _testIndicator As FCFCDFMetaDataTestIndicator
Private _messageType As FCFCDFMetaDataMessageType
Private _interchangeSender As FCFCDFMetaDataInterchangeSender
Private _interchangeRecipient As FCFCDFMetaDataInterchangeRecipient
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._interchangeRecipient = New FCFCDFMetaDataInterchangeRecipient()
Me._interchangeSender = New FCFCDFMetaDataInterchangeSender()
Me._preparation = New FCFCDFMetaDataPreparation()
End Sub
_
Public Property Preparation() As FCFCDFMetaDataPreparation
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 FCFCDFMetaDataMessageGroup
Get
Return Me._messageGroup
End Get
Set
Me._messageGroup = value
End Set
End Property
_
Public Property TestIndicator() As FCFCDFMetaDataTestIndicator
Get
Return Me._testIndicator
End Get
Set
Me._testIndicator = value
End Set
End Property
_
Public Property MessageType() As FCFCDFMetaDataMessageType
Get
Return Me._messageType
End Get
Set
Me._messageType = value
End Set
End Property
_
Public Property InterchangeSender() As FCFCDFMetaDataInterchangeSender
Get
Return Me._interchangeSender
End Get
Set
Me._interchangeSender = value
End Set
End Property
_
Public Property InterchangeRecipient() As FCFCDFMetaDataInterchangeRecipient
Get
Return Me._interchangeRecipient
End Get
Set
Me._interchangeRecipient = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFMetaData))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFMetaData object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFMetaData object
'''
''' string to deserialize
''' Output FCFCDFMetaData 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 FCFCDFMetaData, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFMetaData)
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 FCFCDFMetaData) 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 FCFCDFMetaData
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFMetaData)
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 FCFCDFMetaData
Return CType(SerializerXml.Deserialize(s),FCFCDFMetaData)
End Function
#End Region
'''
''' Serializes current FCFCDFMetaData 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFMetaData object
'''
''' File to load and deserialize
''' Output FCFCDFMetaData 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFMetaData, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFMetaData)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFMetaData, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFMetaData) 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 FCFCDFMetaData
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFMetaData
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFMetaDataPreparation
#Region "Private fields"
Private _date As Date
Private _time As Date
Private Shared _serializerXml 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 SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFMetaDataPreparation))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFMetaDataPreparation object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFMetaDataPreparation object
'''
''' string to deserialize
''' Output FCFCDFMetaDataPreparation 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 FCFCDFMetaDataPreparation, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFMetaDataPreparation)
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 FCFCDFMetaDataPreparation) 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 FCFCDFMetaDataPreparation
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFMetaDataPreparation)
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 FCFCDFMetaDataPreparation
Return CType(SerializerXml.Deserialize(s),FCFCDFMetaDataPreparation)
End Function
#End Region
'''
''' Serializes current FCFCDFMetaDataPreparation 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFMetaDataPreparation object
'''
''' File to load and deserialize
''' Output FCFCDFMetaDataPreparation 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFMetaDataPreparation, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFMetaDataPreparation)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFMetaDataPreparation, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFMetaDataPreparation) 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 FCFCDFMetaDataPreparation
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFMetaDataPreparation
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, encoding)
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
_
Public Enum FCFCDFMetaDataMessageGroup
'''
ZBE
'''
ZBV
End Enum
_
Public Enum FCFCDFMetaDataTestIndicator
'''
_
Item1
End Enum
_
Public Enum FCFCDFMetaDataMessageType
'''
FCFCDF
End Enum
_
Partial Public Class FCFCDFMetaDataInterchangeSender
#Region "Private fields"
Private _identification As FCFCDFMetaDataInterchangeSenderIdentification
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._identification = New FCFCDFMetaDataInterchangeSenderIdentification()
End Sub
_
Public Property Identification() As FCFCDFMetaDataInterchangeSenderIdentification
Get
Return Me._identification
End Get
Set
Me._identification = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFMetaDataInterchangeSender))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFMetaDataInterchangeSender object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFMetaDataInterchangeSender object
'''
''' string to deserialize
''' Output FCFCDFMetaDataInterchangeSender 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 FCFCDFMetaDataInterchangeSender, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFMetaDataInterchangeSender)
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 FCFCDFMetaDataInterchangeSender) 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 FCFCDFMetaDataInterchangeSender
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFMetaDataInterchangeSender)
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 FCFCDFMetaDataInterchangeSender
Return CType(SerializerXml.Deserialize(s),FCFCDFMetaDataInterchangeSender)
End Function
#End Region
'''
''' Serializes current FCFCDFMetaDataInterchangeSender 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFMetaDataInterchangeSender object
'''
''' File to load and deserialize
''' Output FCFCDFMetaDataInterchangeSender 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFMetaDataInterchangeSender, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFMetaDataInterchangeSender)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFMetaDataInterchangeSender, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFMetaDataInterchangeSender) 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 FCFCDFMetaDataInterchangeSender
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFMetaDataInterchangeSender
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFMetaDataInterchangeSenderIdentification
#Region "Private fields"
Private _referenceNumber As String
Private _subsidiaryNumber As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property ReferenceNumber() As String
Get
Return Me._referenceNumber
End Get
Set
Me._referenceNumber = value
End Set
End Property
_
Public Property SubsidiaryNumber() As String
Get
Return Me._subsidiaryNumber
End Get
Set
Me._subsidiaryNumber = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFMetaDataInterchangeSenderIdentification))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFMetaDataInterchangeSenderIdentification object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFMetaDataInterchangeSenderIdentification object
'''
''' string to deserialize
''' Output FCFCDFMetaDataInterchangeSenderIdentification 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 FCFCDFMetaDataInterchangeSenderIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFMetaDataInterchangeSenderIdentification)
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 FCFCDFMetaDataInterchangeSenderIdentification) 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 FCFCDFMetaDataInterchangeSenderIdentification
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFMetaDataInterchangeSenderIdentification)
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 FCFCDFMetaDataInterchangeSenderIdentification
Return CType(SerializerXml.Deserialize(s),FCFCDFMetaDataInterchangeSenderIdentification)
End Function
#End Region
'''
''' Serializes current FCFCDFMetaDataInterchangeSenderIdentification 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFMetaDataInterchangeSenderIdentification object
'''
''' File to load and deserialize
''' Output FCFCDFMetaDataInterchangeSenderIdentification 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFMetaDataInterchangeSenderIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFMetaDataInterchangeSenderIdentification)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFMetaDataInterchangeSenderIdentification, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFMetaDataInterchangeSenderIdentification) 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 FCFCDFMetaDataInterchangeSenderIdentification
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFMetaDataInterchangeSenderIdentification
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFMetaDataInterchangeRecipient
#Region "Private fields"
Private _identification As FCFCDFMetaDataInterchangeRecipientIdentification
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._identification = New FCFCDFMetaDataInterchangeRecipientIdentification()
End Sub
_
Public Property Identification() As FCFCDFMetaDataInterchangeRecipientIdentification
Get
Return Me._identification
End Get
Set
Me._identification = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFMetaDataInterchangeRecipient))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFMetaDataInterchangeRecipient object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFMetaDataInterchangeRecipient object
'''
''' string to deserialize
''' Output FCFCDFMetaDataInterchangeRecipient 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 FCFCDFMetaDataInterchangeRecipient, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFMetaDataInterchangeRecipient)
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 FCFCDFMetaDataInterchangeRecipient) 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 FCFCDFMetaDataInterchangeRecipient
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFMetaDataInterchangeRecipient)
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 FCFCDFMetaDataInterchangeRecipient
Return CType(SerializerXml.Deserialize(s),FCFCDFMetaDataInterchangeRecipient)
End Function
#End Region
'''
''' Serializes current FCFCDFMetaDataInterchangeRecipient 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFMetaDataInterchangeRecipient object
'''
''' File to load and deserialize
''' Output FCFCDFMetaDataInterchangeRecipient 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFMetaDataInterchangeRecipient, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFMetaDataInterchangeRecipient)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFMetaDataInterchangeRecipient, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFMetaDataInterchangeRecipient) 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 FCFCDFMetaDataInterchangeRecipient
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFMetaDataInterchangeRecipient
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFMetaDataInterchangeRecipientIdentification
#Region "Private fields"
Private _referenceNumber As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property ReferenceNumber() As String
Get
Return Me._referenceNumber
End Get
Set
Me._referenceNumber = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFMetaDataInterchangeRecipientIdentification))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFMetaDataInterchangeRecipientIdentification object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFMetaDataInterchangeRecipientIdentification object
'''
''' string to deserialize
''' Output FCFCDFMetaDataInterchangeRecipientIdentification 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 FCFCDFMetaDataInterchangeRecipientIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFMetaDataInterchangeRecipientIdentification)
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 FCFCDFMetaDataInterchangeRecipientIdentification) 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 FCFCDFMetaDataInterchangeRecipientIdentification
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFMetaDataInterchangeRecipientIdentification)
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 FCFCDFMetaDataInterchangeRecipientIdentification
Return CType(SerializerXml.Deserialize(s),FCFCDFMetaDataInterchangeRecipientIdentification)
End Function
#End Region
'''
''' Serializes current FCFCDFMetaDataInterchangeRecipientIdentification 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFMetaDataInterchangeRecipientIdentification object
'''
''' File to load and deserialize
''' Output FCFCDFMetaDataInterchangeRecipientIdentification 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFMetaDataInterchangeRecipientIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFMetaDataInterchangeRecipientIdentification)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFMetaDataInterchangeRecipientIdentification, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFMetaDataInterchangeRecipientIdentification) 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 FCFCDFMetaDataInterchangeRecipientIdentification
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFMetaDataInterchangeRecipientIdentification
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFHeader
#Region "Private fields"
Private _messageVersion As String
Private _messageCreationDate As Date
Private _lRN As String
Private _declaration As FCFCDFHeaderDeclaration
Private _prematureInputFlag As String
Private _goodsItemQuantity As String
Private _customsGoodsStatus As String
Private _declarantIsConsigneeFlag As String
Private _customsAuthorisation As FCFCDFHeaderCustomsAuthorisation
Private _inputTaxDeductionFlag As String
Private _goodsLocation As String
Private _departureCountry As String
Private _paymentMethod As FCFCDFHeaderPaymentMethod
Private _currencyCode As FCFCDFHeaderCurrencyCode
Private _additionalInformation As String
Private _taxOffice As String
Private _representativeRelationshipFlag As String
Private _declarationPlace As String
Private _authorisationNumber As String
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._customsAuthorisation = New FCFCDFHeaderCustomsAuthorisation()
Me._declaration = New FCFCDFHeaderDeclaration()
End Sub
_
Public Property MessageVersion() As String
Get
Return Me._messageVersion
End Get
Set
Me._messageVersion = value
End Set
End Property
_
Public Property MessageCreationDate() As Date
Get
Return Me._messageCreationDate
End Get
Set
Me._messageCreationDate = value
End Set
End Property
_
Public Property LRN() As String
Get
Return Me._lRN
End Get
Set
Me._lRN = value
End Set
End Property
_
Public Property Declaration() As FCFCDFHeaderDeclaration
Get
Return Me._declaration
End Get
Set
Me._declaration = value
End Set
End Property
_
Public Property PrematureInputFlag() As String
Get
Return Me._prematureInputFlag
End Get
Set
Me._prematureInputFlag = value
End Set
End Property
_
Public Property GoodsItemQuantity() As String
Get
Return Me._goodsItemQuantity
End Get
Set
Me._goodsItemQuantity = value
End Set
End Property
_
Public Property CustomsGoodsStatus() As String
Get
Return Me._customsGoodsStatus
End Get
Set
Me._customsGoodsStatus = value
End Set
End Property
_
Public Property DeclarantIsConsigneeFlag() As String
Get
Return Me._declarantIsConsigneeFlag
End Get
Set
Me._declarantIsConsigneeFlag = value
End Set
End Property
_
Public Property CustomsAuthorisation() As FCFCDFHeaderCustomsAuthorisation
Get
Return Me._customsAuthorisation
End Get
Set
Me._customsAuthorisation = value
End Set
End Property
_
Public Property InputTaxDeductionFlag() As String
Get
Return Me._inputTaxDeductionFlag
End Get
Set
Me._inputTaxDeductionFlag = value
End Set
End Property
_
Public Property GoodsLocation() As String
Get
Return Me._goodsLocation
End Get
Set
Me._goodsLocation = value
End Set
End Property
_
Public Property DepartureCountry() As String
Get
Return Me._departureCountry
End Get
Set
Me._departureCountry = value
End Set
End Property
_
Public Property PaymentMethod() As FCFCDFHeaderPaymentMethod
Get
Return Me._paymentMethod
End Get
Set
Me._paymentMethod = value
End Set
End Property
_
Public Property CurrencyCode() As FCFCDFHeaderCurrencyCode
Get
Return Me._currencyCode
End Get
Set
Me._currencyCode = value
End Set
End Property
_
Public Property AdditionalInformation() As String
Get
Return Me._additionalInformation
End Get
Set
Me._additionalInformation = value
End Set
End Property
_
Public Property TaxOffice() As String
Get
Return Me._taxOffice
End Get
Set
Me._taxOffice = value
End Set
End Property
_
Public Property RepresentativeRelationshipFlag() As String
Get
Return Me._representativeRelationshipFlag
End Get
Set
Me._representativeRelationshipFlag = value
End Set
End Property
_
Public Property DeclarationPlace() As String
Get
Return Me._declarationPlace
End Get
Set
Me._declarationPlace = 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 SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFHeader))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFHeader object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFHeader object
'''
''' string to deserialize
''' Output FCFCDFHeader 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 FCFCDFHeader, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFHeader)
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 FCFCDFHeader) 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 FCFCDFHeader
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFHeader)
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 FCFCDFHeader
Return CType(SerializerXml.Deserialize(s),FCFCDFHeader)
End Function
#End Region
'''
''' Serializes current FCFCDFHeader 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFHeader object
'''
''' File to load and deserialize
''' Output FCFCDFHeader 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFHeader, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFHeader)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFHeader, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFHeader) 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 FCFCDFHeader
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFHeader
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFHeaderDeclaration
#Region "Private fields"
Private _kind As FCFCDFHeaderDeclarationKind
Private _type As FCFCDFHeaderDeclarationType
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property Kind() As FCFCDFHeaderDeclarationKind
Get
Return Me._kind
End Get
Set
Me._kind = value
End Set
End Property
_
Public Property Type() As FCFCDFHeaderDeclarationType
Get
Return Me._type
End Get
Set
Me._type = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFHeaderDeclaration))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFHeaderDeclaration object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFHeaderDeclaration object
'''
''' string to deserialize
''' Output FCFCDFHeaderDeclaration 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 FCFCDFHeaderDeclaration, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFHeaderDeclaration)
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 FCFCDFHeaderDeclaration) 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 FCFCDFHeaderDeclaration
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFHeaderDeclaration)
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 FCFCDFHeaderDeclaration
Return CType(SerializerXml.Deserialize(s),FCFCDFHeaderDeclaration)
End Function
#End Region
'''
''' Serializes current FCFCDFHeaderDeclaration 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFHeaderDeclaration object
'''
''' File to load and deserialize
''' Output FCFCDFHeaderDeclaration 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFHeaderDeclaration, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFHeaderDeclaration)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFHeaderDeclaration, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFHeaderDeclaration) 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 FCFCDFHeaderDeclaration
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFHeaderDeclaration
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, encoding)
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
_
Public Enum FCFCDFHeaderDeclarationKind
'''
A
'''
B
'''
D
'''
E
End Enum
_
Public Enum FCFCDFHeaderDeclarationType
'''
EZA
End Enum
_
Partial Public Class FCFCDFHeaderCustomsAuthorisation
#Region "Private fields"
Private _endUse As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property EndUse() As String
Get
Return Me._endUse
End Get
Set
Me._endUse = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFHeaderCustomsAuthorisation))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFHeaderCustomsAuthorisation object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFHeaderCustomsAuthorisation object
'''
''' string to deserialize
''' Output FCFCDFHeaderCustomsAuthorisation 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 FCFCDFHeaderCustomsAuthorisation, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFHeaderCustomsAuthorisation)
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 FCFCDFHeaderCustomsAuthorisation) 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 FCFCDFHeaderCustomsAuthorisation
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFHeaderCustomsAuthorisation)
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 FCFCDFHeaderCustomsAuthorisation
Return CType(SerializerXml.Deserialize(s),FCFCDFHeaderCustomsAuthorisation)
End Function
#End Region
'''
''' Serializes current FCFCDFHeaderCustomsAuthorisation 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFHeaderCustomsAuthorisation object
'''
''' File to load and deserialize
''' Output FCFCDFHeaderCustomsAuthorisation 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFHeaderCustomsAuthorisation, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFHeaderCustomsAuthorisation)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFHeaderCustomsAuthorisation, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFHeaderCustomsAuthorisation) 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 FCFCDFHeaderCustomsAuthorisation
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFHeaderCustomsAuthorisation
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, encoding)
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
_
Public Enum FCFCDFHeaderPaymentMethod
'''
A
'''
C
'''
D
'''
E
'''
F
'''
G
End Enum
_
Public Enum FCFCDFHeaderCurrencyCode
'''
EUR
End Enum
_
Partial Public Class FCFCDFDeclarant
#Region "Private fields"
Private _identification As FCFCDFDeclarantIdentification
Private _name As String
Private _address As FCFCDFDeclarantAddress
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._address = New FCFCDFDeclarantAddress()
Me._identification = New FCFCDFDeclarantIdentification()
End Sub
_
Public Property Identification() As FCFCDFDeclarantIdentification
Get
Return Me._identification
End Get
Set
Me._identification = value
End Set
End Property
_
Public Property Name() As String
Get
Return Me._name
End Get
Set
Me._name = value
End Set
End Property
_
Public Property Address() As FCFCDFDeclarantAddress
Get
Return Me._address
End Get
Set
Me._address = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFDeclarant))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFDeclarant object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFDeclarant object
'''
''' string to deserialize
''' Output FCFCDFDeclarant 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 FCFCDFDeclarant, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFDeclarant)
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 FCFCDFDeclarant) 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 FCFCDFDeclarant
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFDeclarant)
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 FCFCDFDeclarant
Return CType(SerializerXml.Deserialize(s),FCFCDFDeclarant)
End Function
#End Region
'''
''' Serializes current FCFCDFDeclarant 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFDeclarant object
'''
''' File to load and deserialize
''' Output FCFCDFDeclarant 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFDeclarant, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFDeclarant)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFDeclarant, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFDeclarant) 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 FCFCDFDeclarant
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFDeclarant
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFDeclarantIdentification
#Region "Private fields"
Private _referenceNumber As String
Private _subsidiaryNumber As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property ReferenceNumber() As String
Get
Return Me._referenceNumber
End Get
Set
Me._referenceNumber = value
End Set
End Property
_
Public Property SubsidiaryNumber() As String
Get
Return Me._subsidiaryNumber
End Get
Set
Me._subsidiaryNumber = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFDeclarantIdentification))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFDeclarantIdentification object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFDeclarantIdentification object
'''
''' string to deserialize
''' Output FCFCDFDeclarantIdentification 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 FCFCDFDeclarantIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFDeclarantIdentification)
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 FCFCDFDeclarantIdentification) 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 FCFCDFDeclarantIdentification
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFDeclarantIdentification)
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 FCFCDFDeclarantIdentification
Return CType(SerializerXml.Deserialize(s),FCFCDFDeclarantIdentification)
End Function
#End Region
'''
''' Serializes current FCFCDFDeclarantIdentification 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFDeclarantIdentification object
'''
''' File to load and deserialize
''' Output FCFCDFDeclarantIdentification 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFDeclarantIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFDeclarantIdentification)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFDeclarantIdentification, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFDeclarantIdentification) 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 FCFCDFDeclarantIdentification
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFDeclarantIdentification
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFDeclarantAddress
#Region "Private fields"
Private _line As String
Private _country As String
Private _postcode As String
Private _city As String
Private _district As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property Line() As String
Get
Return Me._line
End Get
Set
Me._line = value
End Set
End Property
_
Public Property Country() As String
Get
Return Me._country
End Get
Set
Me._country = value
End Set
End Property
_
Public Property Postcode() As String
Get
Return Me._postcode
End Get
Set
Me._postcode = value
End Set
End Property
_
Public Property City() As String
Get
Return Me._city
End Get
Set
Me._city = value
End Set
End Property
_
Public Property District() As String
Get
Return Me._district
End Get
Set
Me._district = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFDeclarantAddress))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFDeclarantAddress object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFDeclarantAddress object
'''
''' string to deserialize
''' Output FCFCDFDeclarantAddress 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 FCFCDFDeclarantAddress, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFDeclarantAddress)
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 FCFCDFDeclarantAddress) 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 FCFCDFDeclarantAddress
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFDeclarantAddress)
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 FCFCDFDeclarantAddress
Return CType(SerializerXml.Deserialize(s),FCFCDFDeclarantAddress)
End Function
#End Region
'''
''' Serializes current FCFCDFDeclarantAddress 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFDeclarantAddress object
'''
''' File to load and deserialize
''' Output FCFCDFDeclarantAddress 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFDeclarantAddress, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFDeclarantAddress)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFDeclarantAddress, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFDeclarantAddress) 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 FCFCDFDeclarantAddress
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFDeclarantAddress
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFRepresentative
#Region "Private fields"
Private _identification As FCFCDFRepresentativeIdentification
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._identification = New FCFCDFRepresentativeIdentification()
End Sub
_
Public Property Identification() As FCFCDFRepresentativeIdentification
Get
Return Me._identification
End Get
Set
Me._identification = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFRepresentative))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFRepresentative object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFRepresentative object
'''
''' string to deserialize
''' Output FCFCDFRepresentative 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 FCFCDFRepresentative, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFRepresentative)
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 FCFCDFRepresentative) 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 FCFCDFRepresentative
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFRepresentative)
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 FCFCDFRepresentative
Return CType(SerializerXml.Deserialize(s),FCFCDFRepresentative)
End Function
#End Region
'''
''' Serializes current FCFCDFRepresentative 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFRepresentative object
'''
''' File to load and deserialize
''' Output FCFCDFRepresentative 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFRepresentative, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFRepresentative)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFRepresentative, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFRepresentative) 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 FCFCDFRepresentative
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFRepresentative
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFRepresentativeIdentification
#Region "Private fields"
Private _referenceNumber As String
Private _subsidiaryNumber As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property ReferenceNumber() As String
Get
Return Me._referenceNumber
End Get
Set
Me._referenceNumber = value
End Set
End Property
_
Public Property SubsidiaryNumber() As String
Get
Return Me._subsidiaryNumber
End Get
Set
Me._subsidiaryNumber = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFRepresentativeIdentification))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFRepresentativeIdentification object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFRepresentativeIdentification object
'''
''' string to deserialize
''' Output FCFCDFRepresentativeIdentification 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 FCFCDFRepresentativeIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFRepresentativeIdentification)
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 FCFCDFRepresentativeIdentification) 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 FCFCDFRepresentativeIdentification
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFRepresentativeIdentification)
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 FCFCDFRepresentativeIdentification
Return CType(SerializerXml.Deserialize(s),FCFCDFRepresentativeIdentification)
End Function
#End Region
'''
''' Serializes current FCFCDFRepresentativeIdentification 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFRepresentativeIdentification object
'''
''' File to load and deserialize
''' Output FCFCDFRepresentativeIdentification 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFRepresentativeIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFRepresentativeIdentification)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFRepresentativeIdentification, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFRepresentativeIdentification) 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 FCFCDFRepresentativeIdentification
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFRepresentativeIdentification
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFPrincipal
#Region "Private fields"
Private _identification As FCFCDFPrincipalIdentification
Private _name As String
Private _address As FCFCDFPrincipalAddress
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._address = New FCFCDFPrincipalAddress()
Me._identification = New FCFCDFPrincipalIdentification()
End Sub
_
Public Property Identification() As FCFCDFPrincipalIdentification
Get
Return Me._identification
End Get
Set
Me._identification = value
End Set
End Property
_
Public Property Name() As String
Get
Return Me._name
End Get
Set
Me._name = value
End Set
End Property
_
Public Property Address() As FCFCDFPrincipalAddress
Get
Return Me._address
End Get
Set
Me._address = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFPrincipal))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFPrincipal object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFPrincipal object
'''
''' string to deserialize
''' Output FCFCDFPrincipal 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 FCFCDFPrincipal, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFPrincipal)
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 FCFCDFPrincipal) 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 FCFCDFPrincipal
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFPrincipal)
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 FCFCDFPrincipal
Return CType(SerializerXml.Deserialize(s),FCFCDFPrincipal)
End Function
#End Region
'''
''' Serializes current FCFCDFPrincipal 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFPrincipal object
'''
''' File to load and deserialize
''' Output FCFCDFPrincipal 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFPrincipal, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFPrincipal)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFPrincipal, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFPrincipal) 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 FCFCDFPrincipal
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFPrincipal
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFPrincipalIdentification
#Region "Private fields"
Private _referenceNumber As String
Private _subsidiaryNumber As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property ReferenceNumber() As String
Get
Return Me._referenceNumber
End Get
Set
Me._referenceNumber = value
End Set
End Property
_
Public Property SubsidiaryNumber() As String
Get
Return Me._subsidiaryNumber
End Get
Set
Me._subsidiaryNumber = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFPrincipalIdentification))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFPrincipalIdentification object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFPrincipalIdentification object
'''
''' string to deserialize
''' Output FCFCDFPrincipalIdentification 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 FCFCDFPrincipalIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFPrincipalIdentification)
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 FCFCDFPrincipalIdentification) 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 FCFCDFPrincipalIdentification
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFPrincipalIdentification)
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 FCFCDFPrincipalIdentification
Return CType(SerializerXml.Deserialize(s),FCFCDFPrincipalIdentification)
End Function
#End Region
'''
''' Serializes current FCFCDFPrincipalIdentification 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFPrincipalIdentification object
'''
''' File to load and deserialize
''' Output FCFCDFPrincipalIdentification 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFPrincipalIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFPrincipalIdentification)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFPrincipalIdentification, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFPrincipalIdentification) 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 FCFCDFPrincipalIdentification
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFPrincipalIdentification
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFPrincipalAddress
#Region "Private fields"
Private _line As String
Private _country As String
Private _postcode As String
Private _city As String
Private _district As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property Line() As String
Get
Return Me._line
End Get
Set
Me._line = value
End Set
End Property
_
Public Property Country() As String
Get
Return Me._country
End Get
Set
Me._country = value
End Set
End Property
_
Public Property Postcode() As String
Get
Return Me._postcode
End Get
Set
Me._postcode = value
End Set
End Property
_
Public Property City() As String
Get
Return Me._city
End Get
Set
Me._city = value
End Set
End Property
_
Public Property District() As String
Get
Return Me._district
End Get
Set
Me._district = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFPrincipalAddress))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFPrincipalAddress object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFPrincipalAddress object
'''
''' string to deserialize
''' Output FCFCDFPrincipalAddress 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 FCFCDFPrincipalAddress, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFPrincipalAddress)
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 FCFCDFPrincipalAddress) 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 FCFCDFPrincipalAddress
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFPrincipalAddress)
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 FCFCDFPrincipalAddress
Return CType(SerializerXml.Deserialize(s),FCFCDFPrincipalAddress)
End Function
#End Region
'''
''' Serializes current FCFCDFPrincipalAddress 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFPrincipalAddress object
'''
''' File to load and deserialize
''' Output FCFCDFPrincipalAddress 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFPrincipalAddress, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFPrincipalAddress)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFPrincipalAddress, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFPrincipalAddress) 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 FCFCDFPrincipalAddress
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFPrincipalAddress
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFContactPerson
#Region "Private fields"
Private _name As String
Private _position As String
Private _phoneNumber As String
Private _mailAddress As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property Name() As String
Get
Return Me._name
End Get
Set
Me._name = value
End Set
End Property
_
Public Property 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 MailAddress() As String
Get
Return Me._mailAddress
End Get
Set
Me._mailAddress = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFContactPerson))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFContactPerson object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFContactPerson object
'''
''' string to deserialize
''' Output FCFCDFContactPerson 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 FCFCDFContactPerson, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFContactPerson)
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 FCFCDFContactPerson) 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 FCFCDFContactPerson
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFContactPerson)
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 FCFCDFContactPerson
Return CType(SerializerXml.Deserialize(s),FCFCDFContactPerson)
End Function
#End Region
'''
''' Serializes current FCFCDFContactPerson 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFContactPerson object
'''
''' File to load and deserialize
''' Output FCFCDFContactPerson 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFContactPerson, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFContactPerson)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFContactPerson, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFContactPerson) 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 FCFCDFContactPerson
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFContactPerson
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFDutyDefermentApproval
#Region "Private fields"
Private _type As String
Private _applicationType As String
Private _accountPrefix As String
Private _accountNumber As String
Private _authorisationNumber As String
Private _dutyDefermentApplicant As FCFCDFDutyDefermentApprovalDutyDefermentApplicant
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._dutyDefermentApplicant = New FCFCDFDutyDefermentApprovalDutyDefermentApplicant()
End Sub
_
Public Property Type() As String
Get
Return Me._type
End Get
Set
Me._type = value
End Set
End Property
_
Public Property ApplicationType() As String
Get
Return Me._applicationType
End Get
Set
Me._applicationType = value
End Set
End Property
_
Public Property AccountPrefix() As String
Get
Return Me._accountPrefix
End Get
Set
Me._accountPrefix = value
End Set
End Property
_
Public Property AccountNumber() As String
Get
Return Me._accountNumber
End Get
Set
Me._accountNumber = value
End Set
End Property
_
Public Property AuthorisationNumber() As String
Get
Return Me._authorisationNumber
End Get
Set
Me._authorisationNumber = value
End Set
End Property
_
Public Property DutyDefermentApplicant() As FCFCDFDutyDefermentApprovalDutyDefermentApplicant
Get
Return Me._dutyDefermentApplicant
End Get
Set
Me._dutyDefermentApplicant = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFDutyDefermentApproval))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFDutyDefermentApproval object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFDutyDefermentApproval object
'''
''' string to deserialize
''' Output FCFCDFDutyDefermentApproval 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 FCFCDFDutyDefermentApproval, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFDutyDefermentApproval)
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 FCFCDFDutyDefermentApproval) 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 FCFCDFDutyDefermentApproval
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFDutyDefermentApproval)
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 FCFCDFDutyDefermentApproval
Return CType(SerializerXml.Deserialize(s),FCFCDFDutyDefermentApproval)
End Function
#End Region
'''
''' Serializes current FCFCDFDutyDefermentApproval 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFDutyDefermentApproval object
'''
''' File to load and deserialize
''' Output FCFCDFDutyDefermentApproval 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFDutyDefermentApproval, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFDutyDefermentApproval)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFDutyDefermentApproval, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFDutyDefermentApproval) 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 FCFCDFDutyDefermentApproval
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFDutyDefermentApproval
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFDutyDefermentApprovalDutyDefermentApplicant
#Region "Private fields"
Private _identification As FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._identification = New FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification()
End Sub
_
Public Property Identification() As FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification
Get
Return Me._identification
End Get
Set
Me._identification = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFDutyDefermentApprovalDutyDefermentApplicant))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFDutyDefermentApprovalDutyDefermentApplicant object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFDutyDefermentApprovalDutyDefermentApplicant object
'''
''' string to deserialize
''' Output FCFCDFDutyDefermentApprovalDutyDefermentApplicant 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 FCFCDFDutyDefermentApprovalDutyDefermentApplicant, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFDutyDefermentApprovalDutyDefermentApplicant)
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 FCFCDFDutyDefermentApprovalDutyDefermentApplicant) 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 FCFCDFDutyDefermentApprovalDutyDefermentApplicant
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFDutyDefermentApprovalDutyDefermentApplicant)
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 FCFCDFDutyDefermentApprovalDutyDefermentApplicant
Return CType(SerializerXml.Deserialize(s),FCFCDFDutyDefermentApprovalDutyDefermentApplicant)
End Function
#End Region
'''
''' Serializes current FCFCDFDutyDefermentApprovalDutyDefermentApplicant 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFDutyDefermentApprovalDutyDefermentApplicant object
'''
''' File to load and deserialize
''' Output FCFCDFDutyDefermentApprovalDutyDefermentApplicant 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFDutyDefermentApprovalDutyDefermentApplicant, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFDutyDefermentApprovalDutyDefermentApplicant)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFDutyDefermentApprovalDutyDefermentApplicant, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFDutyDefermentApprovalDutyDefermentApplicant) 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 FCFCDFDutyDefermentApprovalDutyDefermentApplicant
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFDutyDefermentApprovalDutyDefermentApplicant
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification
#Region "Private fields"
Private _referenceNumber As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property ReferenceNumber() As String
Get
Return Me._referenceNumber
End Get
Set
Me._referenceNumber = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification object
'''
''' string to deserialize
''' Output FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification 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 FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification)
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 FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification) 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 FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification)
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 FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification
Return CType(SerializerXml.Deserialize(s),FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification)
End Function
#End Region
'''
''' Serializes current FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification object
'''
''' File to load and deserialize
''' Output FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification) 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 FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFDutyDefermentApprovalDutyDefermentApplicantIdentification
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFBorderTransportMeans
#Region "Private fields"
Private _mode As String
Private _type As String
Private _information As String
Private _nationality As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property Mode() As String
Get
Return Me._mode
End Get
Set
Me._mode = value
End Set
End Property
_
Public Property Type() As String
Get
Return Me._type
End Get
Set
Me._type = value
End Set
End Property
_
Public Property Information() As String
Get
Return Me._information
End Get
Set
Me._information = value
End Set
End Property
_
Public Property Nationality() As String
Get
Return Me._nationality
End Get
Set
Me._nationality = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFBorderTransportMeans))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFBorderTransportMeans object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFBorderTransportMeans object
'''
''' string to deserialize
''' Output FCFCDFBorderTransportMeans 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 FCFCDFBorderTransportMeans, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBorderTransportMeans)
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 FCFCDFBorderTransportMeans) 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 FCFCDFBorderTransportMeans
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFBorderTransportMeans)
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 FCFCDFBorderTransportMeans
Return CType(SerializerXml.Deserialize(s),FCFCDFBorderTransportMeans)
End Function
#End Region
'''
''' Serializes current FCFCDFBorderTransportMeans 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFBorderTransportMeans object
'''
''' File to load and deserialize
''' Output FCFCDFBorderTransportMeans 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFBorderTransportMeans, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBorderTransportMeans)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFBorderTransportMeans, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFBorderTransportMeans) 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 FCFCDFBorderTransportMeans
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFBorderTransportMeans
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFArrivalTransportMeans
#Region "Private fields"
Private _identity As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property Identity() As String
Get
Return Me._identity
End Get
Set
Me._identity = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFArrivalTransportMeans))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFArrivalTransportMeans object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFArrivalTransportMeans object
'''
''' string to deserialize
''' Output FCFCDFArrivalTransportMeans 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 FCFCDFArrivalTransportMeans, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFArrivalTransportMeans)
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 FCFCDFArrivalTransportMeans) 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 FCFCDFArrivalTransportMeans
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFArrivalTransportMeans)
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 FCFCDFArrivalTransportMeans
Return CType(SerializerXml.Deserialize(s),FCFCDFArrivalTransportMeans)
End Function
#End Region
'''
''' Serializes current FCFCDFArrivalTransportMeans 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFArrivalTransportMeans object
'''
''' File to load and deserialize
''' Output FCFCDFArrivalTransportMeans 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFArrivalTransportMeans, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFArrivalTransportMeans)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFArrivalTransportMeans, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFArrivalTransportMeans) 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 FCFCDFArrivalTransportMeans
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFArrivalTransportMeans
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFPreviousAdministrativeReferences
#Region "Private fields"
Private _type As String
Private _previousAdministrativeReference As FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._previousAdministrativeReference = New FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference()
End Sub
_
Public Property Type() As String
Get
Return Me._type
End Get
Set
Me._type = value
End Set
End Property
_
Public Property PreviousAdministrativeReference() As FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference
Get
Return Me._previousAdministrativeReference
End Get
Set
Me._previousAdministrativeReference = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFPreviousAdministrativeReferences))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFPreviousAdministrativeReferences object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFPreviousAdministrativeReferences object
'''
''' string to deserialize
''' Output FCFCDFPreviousAdministrativeReferences 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 FCFCDFPreviousAdministrativeReferences, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFPreviousAdministrativeReferences)
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 FCFCDFPreviousAdministrativeReferences) 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 FCFCDFPreviousAdministrativeReferences
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFPreviousAdministrativeReferences)
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 FCFCDFPreviousAdministrativeReferences
Return CType(SerializerXml.Deserialize(s),FCFCDFPreviousAdministrativeReferences)
End Function
#End Region
'''
''' Serializes current FCFCDFPreviousAdministrativeReferences 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFPreviousAdministrativeReferences object
'''
''' File to load and deserialize
''' Output FCFCDFPreviousAdministrativeReferences 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFPreviousAdministrativeReferences, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFPreviousAdministrativeReferences)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFPreviousAdministrativeReferences, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFPreviousAdministrativeReferences) 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 FCFCDFPreviousAdministrativeReferences
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFPreviousAdministrativeReferences
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference
#Region "Private fields"
Private _referenceNumber As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property ReferenceNumber() As String
Get
Return Me._referenceNumber
End Get
Set
Me._referenceNumber = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference object
'''
''' string to deserialize
''' Output FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference 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 FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference)
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 FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference) 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 FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference)
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 FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference
Return CType(SerializerXml.Deserialize(s),FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference)
End Function
#End Region
'''
''' Serializes current FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference object
'''
''' File to load and deserialize
''' Output FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference) 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 FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFPreviousAdministrativeReferencesPreviousAdministrativeReference
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFSummaryDeclaration
#Region "Private fields"
Private _identificationIndicator As FCFCDFSummaryDeclarationIdentificationIndicator
Private _goodsItem As List(Of FCFCDFSummaryDeclarationGoodsItem)
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._goodsItem = New List(Of FCFCDFSummaryDeclarationGoodsItem)()
End Sub
_
Public Property IdentificationIndicator() As FCFCDFSummaryDeclarationIdentificationIndicator
Get
Return Me._identificationIndicator
End Get
Set
Me._identificationIndicator = value
End Set
End Property
_
Public Property GoodsItem() As List(Of FCFCDFSummaryDeclarationGoodsItem)
Get
Return Me._goodsItem
End Get
Set
Me._goodsItem = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFSummaryDeclaration))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFSummaryDeclaration object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFSummaryDeclaration object
'''
''' string to deserialize
''' Output FCFCDFSummaryDeclaration 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 FCFCDFSummaryDeclaration, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFSummaryDeclaration)
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 FCFCDFSummaryDeclaration) 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 FCFCDFSummaryDeclaration
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFSummaryDeclaration)
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 FCFCDFSummaryDeclaration
Return CType(SerializerXml.Deserialize(s),FCFCDFSummaryDeclaration)
End Function
#End Region
'''
''' Serializes current FCFCDFSummaryDeclaration 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFSummaryDeclaration object
'''
''' File to load and deserialize
''' Output FCFCDFSummaryDeclaration 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFSummaryDeclaration, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFSummaryDeclaration)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFSummaryDeclaration, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFSummaryDeclaration) 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 FCFCDFSummaryDeclaration
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFSummaryDeclaration
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, encoding)
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
_
Public Enum FCFCDFSummaryDeclarationIdentificationIndicator
'''
AWB
'''
REG
End Enum
_
Partial Public Class FCFCDFSummaryDeclarationGoodsItem
#Region "Private fields"
Private _quantity As String
Private _identificationByKey As FCFCDFSummaryDeclarationGoodsItemIdentificationByKey
Private _identificationByRegistration As FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._identificationByRegistration = New FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration()
Me._identificationByKey = New FCFCDFSummaryDeclarationGoodsItemIdentificationByKey()
End Sub
_
Public Property Quantity() As String
Get
Return Me._quantity
End Get
Set
Me._quantity = value
End Set
End Property
_
Public Property IdentificationByKey() As FCFCDFSummaryDeclarationGoodsItemIdentificationByKey
Get
Return Me._identificationByKey
End Get
Set
Me._identificationByKey = value
End Set
End Property
_
Public Property IdentificationByRegistration() As FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration
Get
Return Me._identificationByRegistration
End Get
Set
Me._identificationByRegistration = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFSummaryDeclarationGoodsItem))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFSummaryDeclarationGoodsItem object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFSummaryDeclarationGoodsItem object
'''
''' string to deserialize
''' Output FCFCDFSummaryDeclarationGoodsItem 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 FCFCDFSummaryDeclarationGoodsItem, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFSummaryDeclarationGoodsItem)
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 FCFCDFSummaryDeclarationGoodsItem) 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 FCFCDFSummaryDeclarationGoodsItem
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFSummaryDeclarationGoodsItem)
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 FCFCDFSummaryDeclarationGoodsItem
Return CType(SerializerXml.Deserialize(s),FCFCDFSummaryDeclarationGoodsItem)
End Function
#End Region
'''
''' Serializes current FCFCDFSummaryDeclarationGoodsItem 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFSummaryDeclarationGoodsItem object
'''
''' File to load and deserialize
''' Output FCFCDFSummaryDeclarationGoodsItem 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFSummaryDeclarationGoodsItem, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFSummaryDeclarationGoodsItem)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFSummaryDeclarationGoodsItem, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFSummaryDeclarationGoodsItem) 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 FCFCDFSummaryDeclarationGoodsItem
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFSummaryDeclarationGoodsItem
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFSummaryDeclarationGoodsItemIdentificationByKey
#Region "Private fields"
Private _kind As FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyKind
Private _number As String
Private _custodian As FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._custodian = New FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian()
End Sub
_
Public Property Kind() As FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyKind
Get
Return Me._kind
End Get
Set
Me._kind = value
End Set
End Property
_
Public Property Number() As String
Get
Return Me._number
End Get
Set
Me._number = value
End Set
End Property
_
Public Property Custodian() As FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian
Get
Return Me._custodian
End Get
Set
Me._custodian = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFSummaryDeclarationGoodsItemIdentificationByKey))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFSummaryDeclarationGoodsItemIdentificationByKey object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFSummaryDeclarationGoodsItemIdentificationByKey object
'''
''' string to deserialize
''' Output FCFCDFSummaryDeclarationGoodsItemIdentificationByKey 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 FCFCDFSummaryDeclarationGoodsItemIdentificationByKey, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFSummaryDeclarationGoodsItemIdentificationByKey)
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 FCFCDFSummaryDeclarationGoodsItemIdentificationByKey) 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 FCFCDFSummaryDeclarationGoodsItemIdentificationByKey
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFSummaryDeclarationGoodsItemIdentificationByKey)
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 FCFCDFSummaryDeclarationGoodsItemIdentificationByKey
Return CType(SerializerXml.Deserialize(s),FCFCDFSummaryDeclarationGoodsItemIdentificationByKey)
End Function
#End Region
'''
''' Serializes current FCFCDFSummaryDeclarationGoodsItemIdentificationByKey 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFSummaryDeclarationGoodsItemIdentificationByKey object
'''
''' File to load and deserialize
''' Output FCFCDFSummaryDeclarationGoodsItemIdentificationByKey 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFSummaryDeclarationGoodsItemIdentificationByKey, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFSummaryDeclarationGoodsItemIdentificationByKey)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFSummaryDeclarationGoodsItemIdentificationByKey, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFSummaryDeclarationGoodsItemIdentificationByKey) 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 FCFCDFSummaryDeclarationGoodsItemIdentificationByKey
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFSummaryDeclarationGoodsItemIdentificationByKey
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, encoding)
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
_
Public Enum FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyKind
'''
AWB
'''
ULD
End Enum
_
Partial Public Class FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian
#Region "Private fields"
Private _identification As FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._identification = New FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification()
End Sub
_
Public Property Identification() As FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification
Get
Return Me._identification
End Get
Set
Me._identification = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian object
'''
''' string to deserialize
''' Output FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian 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 FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian)
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 FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian) 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 FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian)
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 FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian
Return CType(SerializerXml.Deserialize(s),FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian)
End Function
#End Region
'''
''' Serializes current FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian object
'''
''' File to load and deserialize
''' Output FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian) 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 FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodian
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification
#Region "Private fields"
Private _referenceNumber As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property ReferenceNumber() As String
Get
Return Me._referenceNumber
End Get
Set
Me._referenceNumber = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification object
'''
''' string to deserialize
''' Output FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification 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 FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification)
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 FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification) 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 FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification)
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 FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification
Return CType(SerializerXml.Deserialize(s),FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification)
End Function
#End Region
'''
''' Serializes current FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification object
'''
''' File to load and deserialize
''' Output FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification) 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 FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFSummaryDeclarationGoodsItemIdentificationByKeyCustodianIdentification
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration
#Region "Private fields"
Private _mRN As String
Private _referencedRegistrationNumber As String
Private _referencedSequenceNumber As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property MRN() As String
Get
Return Me._mRN
End Get
Set
Me._mRN = value
End Set
End Property
_
Public Property ReferencedRegistrationNumber() As String
Get
Return Me._referencedRegistrationNumber
End Get
Set
Me._referencedRegistrationNumber = value
End Set
End Property
_
Public Property ReferencedSequenceNumber() As String
Get
Return Me._referencedSequenceNumber
End Get
Set
Me._referencedSequenceNumber = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration object
'''
''' string to deserialize
''' Output FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration 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 FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration)
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 FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration) 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 FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration)
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 FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration
Return CType(SerializerXml.Deserialize(s),FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration)
End Function
#End Region
'''
''' Serializes current FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration object
'''
''' File to load and deserialize
''' Output FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration) 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 FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFSummaryDeclarationGoodsItemIdentificationByRegistration
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFCustomsWarehouse
#Region "Private fields"
Private _lRN As String
Private _sequenceNumber As FCFCDFCustomsWarehouseSequenceNumber
Private _goodsItemQuantity As String
Private _customsAuthorisation As FCFCDFCustomsWarehouseCustomsAuthorisation
Private _goodsItem As List(Of FCFCDFCustomsWarehouseGoodsItem)
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._goodsItem = New List(Of FCFCDFCustomsWarehouseGoodsItem)()
Me._customsAuthorisation = New FCFCDFCustomsWarehouseCustomsAuthorisation()
End Sub
_
Public Property LRN() As String
Get
Return Me._lRN
End Get
Set
Me._lRN = value
End Set
End Property
_
Public Property SequenceNumber() As FCFCDFCustomsWarehouseSequenceNumber
Get
Return Me._sequenceNumber
End Get
Set
Me._sequenceNumber = value
End Set
End Property
_
Public Property GoodsItemQuantity() As String
Get
Return Me._goodsItemQuantity
End Get
Set
Me._goodsItemQuantity = value
End Set
End Property
_
Public Property CustomsAuthorisation() As FCFCDFCustomsWarehouseCustomsAuthorisation
Get
Return Me._customsAuthorisation
End Get
Set
Me._customsAuthorisation = value
End Set
End Property
_
Public Property GoodsItem() As List(Of FCFCDFCustomsWarehouseGoodsItem)
Get
Return Me._goodsItem
End Get
Set
Me._goodsItem = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFCustomsWarehouse))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFCustomsWarehouse object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFCustomsWarehouse object
'''
''' string to deserialize
''' Output FCFCDFCustomsWarehouse 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 FCFCDFCustomsWarehouse, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFCustomsWarehouse)
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 FCFCDFCustomsWarehouse) 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 FCFCDFCustomsWarehouse
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFCustomsWarehouse)
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 FCFCDFCustomsWarehouse
Return CType(SerializerXml.Deserialize(s),FCFCDFCustomsWarehouse)
End Function
#End Region
'''
''' Serializes current FCFCDFCustomsWarehouse 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFCustomsWarehouse object
'''
''' File to load and deserialize
''' Output FCFCDFCustomsWarehouse 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFCustomsWarehouse, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFCustomsWarehouse)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFCustomsWarehouse, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFCustomsWarehouse) 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 FCFCDFCustomsWarehouse
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFCustomsWarehouse
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, encoding)
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
_
Public Enum FCFCDFCustomsWarehouseSequenceNumber
'''
_
Item1
End Enum
_
Partial Public Class FCFCDFCustomsWarehouseCustomsAuthorisation
#Region "Private fields"
Private _warehouseOwner As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property WarehouseOwner() As String
Get
Return Me._warehouseOwner
End Get
Set
Me._warehouseOwner = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFCustomsWarehouseCustomsAuthorisation))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFCustomsWarehouseCustomsAuthorisation object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFCustomsWarehouseCustomsAuthorisation object
'''
''' string to deserialize
''' Output FCFCDFCustomsWarehouseCustomsAuthorisation 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 FCFCDFCustomsWarehouseCustomsAuthorisation, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFCustomsWarehouseCustomsAuthorisation)
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 FCFCDFCustomsWarehouseCustomsAuthorisation) 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 FCFCDFCustomsWarehouseCustomsAuthorisation
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFCustomsWarehouseCustomsAuthorisation)
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 FCFCDFCustomsWarehouseCustomsAuthorisation
Return CType(SerializerXml.Deserialize(s),FCFCDFCustomsWarehouseCustomsAuthorisation)
End Function
#End Region
'''
''' Serializes current FCFCDFCustomsWarehouseCustomsAuthorisation 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFCustomsWarehouseCustomsAuthorisation object
'''
''' File to load and deserialize
''' Output FCFCDFCustomsWarehouseCustomsAuthorisation 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFCustomsWarehouseCustomsAuthorisation, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFCustomsWarehouseCustomsAuthorisation)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFCustomsWarehouseCustomsAuthorisation, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFCustomsWarehouseCustomsAuthorisation) 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 FCFCDFCustomsWarehouseCustomsAuthorisation
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFCustomsWarehouseCustomsAuthorisation
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFCustomsWarehouseGoodsItem
#Region "Private fields"
Private _sequenceNumber As String
Private _mRN As String
Private _referencedRegistrationNumber As String
Private _referencedSequenceNumber As String
Private _accessViaAtlasFlag As String
Private _commodityCode As String
Private _usualProcessingFlag As String
Private _complement As String
Private _commercialAmount As FCFCDFCustomsWarehouseGoodsItemCommercialAmount
Private _debitAmount As FCFCDFCustomsWarehouseGoodsItemDebitAmount
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._debitAmount = New FCFCDFCustomsWarehouseGoodsItemDebitAmount()
Me._commercialAmount = New FCFCDFCustomsWarehouseGoodsItemCommercialAmount()
End Sub
_
Public Property SequenceNumber() As String
Get
Return Me._sequenceNumber
End Get
Set
Me._sequenceNumber = value
End Set
End Property
_
Public Property MRN() As String
Get
Return Me._mRN
End Get
Set
Me._mRN = value
End Set
End Property
_
Public Property ReferencedRegistrationNumber() As String
Get
Return Me._referencedRegistrationNumber
End Get
Set
Me._referencedRegistrationNumber = value
End Set
End Property
_
Public Property ReferencedSequenceNumber() As String
Get
Return Me._referencedSequenceNumber
End Get
Set
Me._referencedSequenceNumber = value
End Set
End Property
_
Public Property AccessViaAtlasFlag() As String
Get
Return Me._accessViaAtlasFlag
End Get
Set
Me._accessViaAtlasFlag = value
End Set
End Property
_
Public Property CommodityCode() As String
Get
Return Me._commodityCode
End Get
Set
Me._commodityCode = value
End Set
End Property
_
Public Property UsualProcessingFlag() As String
Get
Return Me._usualProcessingFlag
End Get
Set
Me._usualProcessingFlag = value
End Set
End Property
_
Public Property Complement() As String
Get
Return Me._complement
End Get
Set
Me._complement = value
End Set
End Property
_
Public Property CommercialAmount() As FCFCDFCustomsWarehouseGoodsItemCommercialAmount
Get
Return Me._commercialAmount
End Get
Set
Me._commercialAmount = value
End Set
End Property
_
Public Property DebitAmount() As FCFCDFCustomsWarehouseGoodsItemDebitAmount
Get
Return Me._debitAmount
End Get
Set
Me._debitAmount = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFCustomsWarehouseGoodsItem))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFCustomsWarehouseGoodsItem object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFCustomsWarehouseGoodsItem object
'''
''' string to deserialize
''' Output FCFCDFCustomsWarehouseGoodsItem 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 FCFCDFCustomsWarehouseGoodsItem, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFCustomsWarehouseGoodsItem)
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 FCFCDFCustomsWarehouseGoodsItem) 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 FCFCDFCustomsWarehouseGoodsItem
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFCustomsWarehouseGoodsItem)
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 FCFCDFCustomsWarehouseGoodsItem
Return CType(SerializerXml.Deserialize(s),FCFCDFCustomsWarehouseGoodsItem)
End Function
#End Region
'''
''' Serializes current FCFCDFCustomsWarehouseGoodsItem 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFCustomsWarehouseGoodsItem object
'''
''' File to load and deserialize
''' Output FCFCDFCustomsWarehouseGoodsItem 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFCustomsWarehouseGoodsItem, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFCustomsWarehouseGoodsItem)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFCustomsWarehouseGoodsItem, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFCustomsWarehouseGoodsItem) 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 FCFCDFCustomsWarehouseGoodsItem
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFCustomsWarehouseGoodsItem
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFCustomsWarehouseGoodsItemCommercialAmount
#Region "Private fields"
Private _quantity As Decimal
Private _measurementUnit As String
Private _qualifier As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property Quantity() As Decimal
Get
Return Me._quantity
End Get
Set
Me._quantity = value
End Set
End Property
_
Public Property MeasurementUnit() As String
Get
Return Me._measurementUnit
End Get
Set
Me._measurementUnit = value
End Set
End Property
_
Public Property Qualifier() As String
Get
Return Me._qualifier
End Get
Set
Me._qualifier = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFCustomsWarehouseGoodsItemCommercialAmount))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFCustomsWarehouseGoodsItemCommercialAmount object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFCustomsWarehouseGoodsItemCommercialAmount object
'''
''' string to deserialize
''' Output FCFCDFCustomsWarehouseGoodsItemCommercialAmount 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 FCFCDFCustomsWarehouseGoodsItemCommercialAmount, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFCustomsWarehouseGoodsItemCommercialAmount)
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 FCFCDFCustomsWarehouseGoodsItemCommercialAmount) 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 FCFCDFCustomsWarehouseGoodsItemCommercialAmount
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFCustomsWarehouseGoodsItemCommercialAmount)
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 FCFCDFCustomsWarehouseGoodsItemCommercialAmount
Return CType(SerializerXml.Deserialize(s),FCFCDFCustomsWarehouseGoodsItemCommercialAmount)
End Function
#End Region
'''
''' Serializes current FCFCDFCustomsWarehouseGoodsItemCommercialAmount 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFCustomsWarehouseGoodsItemCommercialAmount object
'''
''' File to load and deserialize
''' Output FCFCDFCustomsWarehouseGoodsItemCommercialAmount 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFCustomsWarehouseGoodsItemCommercialAmount, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFCustomsWarehouseGoodsItemCommercialAmount)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFCustomsWarehouseGoodsItemCommercialAmount, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFCustomsWarehouseGoodsItemCommercialAmount) 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 FCFCDFCustomsWarehouseGoodsItemCommercialAmount
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFCustomsWarehouseGoodsItemCommercialAmount
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFCustomsWarehouseGoodsItemDebitAmount
#Region "Private fields"
Private _quantity As Decimal
Private _measurementUnit As String
Private _qualifier As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property Quantity() As Decimal
Get
Return Me._quantity
End Get
Set
Me._quantity = value
End Set
End Property
_
Public Property MeasurementUnit() As String
Get
Return Me._measurementUnit
End Get
Set
Me._measurementUnit = value
End Set
End Property
_
Public Property Qualifier() As String
Get
Return Me._qualifier
End Get
Set
Me._qualifier = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFCustomsWarehouseGoodsItemDebitAmount))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFCustomsWarehouseGoodsItemDebitAmount object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFCustomsWarehouseGoodsItemDebitAmount object
'''
''' string to deserialize
''' Output FCFCDFCustomsWarehouseGoodsItemDebitAmount 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 FCFCDFCustomsWarehouseGoodsItemDebitAmount, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFCustomsWarehouseGoodsItemDebitAmount)
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 FCFCDFCustomsWarehouseGoodsItemDebitAmount) 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 FCFCDFCustomsWarehouseGoodsItemDebitAmount
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFCustomsWarehouseGoodsItemDebitAmount)
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 FCFCDFCustomsWarehouseGoodsItemDebitAmount
Return CType(SerializerXml.Deserialize(s),FCFCDFCustomsWarehouseGoodsItemDebitAmount)
End Function
#End Region
'''
''' Serializes current FCFCDFCustomsWarehouseGoodsItemDebitAmount 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFCustomsWarehouseGoodsItemDebitAmount object
'''
''' File to load and deserialize
''' Output FCFCDFCustomsWarehouseGoodsItemDebitAmount 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFCustomsWarehouseGoodsItemDebitAmount, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFCustomsWarehouseGoodsItemDebitAmount)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFCustomsWarehouseGoodsItemDebitAmount, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFCustomsWarehouseGoodsItemDebitAmount) 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 FCFCDFCustomsWarehouseGoodsItemDebitAmount
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFCustomsWarehouseGoodsItemDebitAmount
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFInwardProcessing
#Region "Private fields"
Private _sequenceNumber As FCFCDFInwardProcessingSequenceNumber
Private _goodsItemQuantity As String
Private _customsAuthorisation As FCFCDFInwardProcessingCustomsAuthorisation
Private _simplifiedGrantAuthorisationFlag As String
Private _monitoringCustomsOffice As FCFCDFInwardProcessingMonitoringCustomsOffice
Private _goodsItem As List(Of FCFCDFInwardProcessingGoodsItem)
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._goodsItem = New List(Of FCFCDFInwardProcessingGoodsItem)()
Me._monitoringCustomsOffice = New FCFCDFInwardProcessingMonitoringCustomsOffice()
Me._customsAuthorisation = New FCFCDFInwardProcessingCustomsAuthorisation()
End Sub
_
Public Property SequenceNumber() As FCFCDFInwardProcessingSequenceNumber
Get
Return Me._sequenceNumber
End Get
Set
Me._sequenceNumber = value
End Set
End Property
_
Public Property GoodsItemQuantity() As String
Get
Return Me._goodsItemQuantity
End Get
Set
Me._goodsItemQuantity = value
End Set
End Property
_
Public Property CustomsAuthorisation() As FCFCDFInwardProcessingCustomsAuthorisation
Get
Return Me._customsAuthorisation
End Get
Set
Me._customsAuthorisation = value
End Set
End Property
_
Public Property SimplifiedGrantAuthorisationFlag() As String
Get
Return Me._simplifiedGrantAuthorisationFlag
End Get
Set
Me._simplifiedGrantAuthorisationFlag = value
End Set
End Property
_
Public Property MonitoringCustomsOffice() As FCFCDFInwardProcessingMonitoringCustomsOffice
Get
Return Me._monitoringCustomsOffice
End Get
Set
Me._monitoringCustomsOffice = value
End Set
End Property
_
Public Property GoodsItem() As List(Of FCFCDFInwardProcessingGoodsItem)
Get
Return Me._goodsItem
End Get
Set
Me._goodsItem = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFInwardProcessing))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFInwardProcessing object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFInwardProcessing object
'''
''' string to deserialize
''' Output FCFCDFInwardProcessing 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 FCFCDFInwardProcessing, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFInwardProcessing)
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 FCFCDFInwardProcessing) 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 FCFCDFInwardProcessing
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFInwardProcessing)
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 FCFCDFInwardProcessing
Return CType(SerializerXml.Deserialize(s),FCFCDFInwardProcessing)
End Function
#End Region
'''
''' Serializes current FCFCDFInwardProcessing 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFInwardProcessing object
'''
''' File to load and deserialize
''' Output FCFCDFInwardProcessing 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFInwardProcessing, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFInwardProcessing)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFInwardProcessing, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFInwardProcessing) 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 FCFCDFInwardProcessing
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFInwardProcessing
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, encoding)
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
_
Public Enum FCFCDFInwardProcessingSequenceNumber
'''
_
Item1
End Enum
_
Partial Public Class FCFCDFInwardProcessingCustomsAuthorisation
#Region "Private fields"
Private _processingOwner As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property ProcessingOwner() As String
Get
Return Me._processingOwner
End Get
Set
Me._processingOwner = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFInwardProcessingCustomsAuthorisation))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFInwardProcessingCustomsAuthorisation object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFInwardProcessingCustomsAuthorisation object
'''
''' string to deserialize
''' Output FCFCDFInwardProcessingCustomsAuthorisation 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 FCFCDFInwardProcessingCustomsAuthorisation, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFInwardProcessingCustomsAuthorisation)
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 FCFCDFInwardProcessingCustomsAuthorisation) 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 FCFCDFInwardProcessingCustomsAuthorisation
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFInwardProcessingCustomsAuthorisation)
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 FCFCDFInwardProcessingCustomsAuthorisation
Return CType(SerializerXml.Deserialize(s),FCFCDFInwardProcessingCustomsAuthorisation)
End Function
#End Region
'''
''' Serializes current FCFCDFInwardProcessingCustomsAuthorisation 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFInwardProcessingCustomsAuthorisation object
'''
''' File to load and deserialize
''' Output FCFCDFInwardProcessingCustomsAuthorisation 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFInwardProcessingCustomsAuthorisation, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFInwardProcessingCustomsAuthorisation)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFInwardProcessingCustomsAuthorisation, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFInwardProcessingCustomsAuthorisation) 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 FCFCDFInwardProcessingCustomsAuthorisation
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFInwardProcessingCustomsAuthorisation
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFInwardProcessingMonitoringCustomsOffice
#Region "Private fields"
Private _identification As FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._identification = New FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification()
End Sub
_
Public Property Identification() As FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification
Get
Return Me._identification
End Get
Set
Me._identification = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFInwardProcessingMonitoringCustomsOffice))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFInwardProcessingMonitoringCustomsOffice object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFInwardProcessingMonitoringCustomsOffice object
'''
''' string to deserialize
''' Output FCFCDFInwardProcessingMonitoringCustomsOffice 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 FCFCDFInwardProcessingMonitoringCustomsOffice, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFInwardProcessingMonitoringCustomsOffice)
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 FCFCDFInwardProcessingMonitoringCustomsOffice) 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 FCFCDFInwardProcessingMonitoringCustomsOffice
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFInwardProcessingMonitoringCustomsOffice)
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 FCFCDFInwardProcessingMonitoringCustomsOffice
Return CType(SerializerXml.Deserialize(s),FCFCDFInwardProcessingMonitoringCustomsOffice)
End Function
#End Region
'''
''' Serializes current FCFCDFInwardProcessingMonitoringCustomsOffice 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFInwardProcessingMonitoringCustomsOffice object
'''
''' File to load and deserialize
''' Output FCFCDFInwardProcessingMonitoringCustomsOffice 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFInwardProcessingMonitoringCustomsOffice, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFInwardProcessingMonitoringCustomsOffice)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFInwardProcessingMonitoringCustomsOffice, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFInwardProcessingMonitoringCustomsOffice) 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 FCFCDFInwardProcessingMonitoringCustomsOffice
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFInwardProcessingMonitoringCustomsOffice
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification
#Region "Private fields"
Private _referenceNumber As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property ReferenceNumber() As String
Get
Return Me._referenceNumber
End Get
Set
Me._referenceNumber = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification object
'''
''' string to deserialize
''' Output FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification 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 FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification)
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 FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification) 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 FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification)
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 FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification
Return CType(SerializerXml.Deserialize(s),FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification)
End Function
#End Region
'''
''' Serializes current FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification object
'''
''' File to load and deserialize
''' Output FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification) 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 FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFInwardProcessingMonitoringCustomsOfficeIdentification
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFInwardProcessingGoodsItem
#Region "Private fields"
Private _sequenceNumber As String
Private _mRN As String
Private _referencedRegistrationNumber As String
Private _referencedSequenceNumber As String
Private _accessViaAtlasFlag As String
Private _goodsRelatedInformation As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property SequenceNumber() As String
Get
Return Me._sequenceNumber
End Get
Set
Me._sequenceNumber = value
End Set
End Property
_
Public Property MRN() As String
Get
Return Me._mRN
End Get
Set
Me._mRN = value
End Set
End Property
_
Public Property ReferencedRegistrationNumber() As String
Get
Return Me._referencedRegistrationNumber
End Get
Set
Me._referencedRegistrationNumber = value
End Set
End Property
_
Public Property ReferencedSequenceNumber() As String
Get
Return Me._referencedSequenceNumber
End Get
Set
Me._referencedSequenceNumber = value
End Set
End Property
_
Public Property AccessViaAtlasFlag() As String
Get
Return Me._accessViaAtlasFlag
End Get
Set
Me._accessViaAtlasFlag = value
End Set
End Property
_
Public Property GoodsRelatedInformation() As String
Get
Return Me._goodsRelatedInformation
End Get
Set
Me._goodsRelatedInformation = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFInwardProcessingGoodsItem))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFInwardProcessingGoodsItem object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFInwardProcessingGoodsItem object
'''
''' string to deserialize
''' Output FCFCDFInwardProcessingGoodsItem 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 FCFCDFInwardProcessingGoodsItem, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFInwardProcessingGoodsItem)
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 FCFCDFInwardProcessingGoodsItem) 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 FCFCDFInwardProcessingGoodsItem
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFInwardProcessingGoodsItem)
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 FCFCDFInwardProcessingGoodsItem
Return CType(SerializerXml.Deserialize(s),FCFCDFInwardProcessingGoodsItem)
End Function
#End Region
'''
''' Serializes current FCFCDFInwardProcessingGoodsItem 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFInwardProcessingGoodsItem object
'''
''' File to load and deserialize
''' Output FCFCDFInwardProcessingGoodsItem 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFInwardProcessingGoodsItem, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFInwardProcessingGoodsItem)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFInwardProcessingGoodsItem, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFInwardProcessingGoodsItem) 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 FCFCDFInwardProcessingGoodsItem
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFInwardProcessingGoodsItem
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFBody
#Region "Private fields"
Private _customsValueFlag As String
Private _consignor As FCFCDFBodyConsignor
Private _consignee As FCFCDFBodyConsignee
Private _additionalDutyReferences As List(Of FCFCDFBodyAdditionalDutyReferences)
Private _containers As FCFCDFBodyContainers
Private _deliveryTerms As FCFCDFBodyDeliveryTerms
Private _paymentTransaction As FCFCDFBodyPaymentTransaction
Private _foreignTradeStatistics As FCFCDFBodyForeignTradeStatistics
Private _customsValue As FCFCDFBodyCustomsValue
Private _document As List(Of FCFCDFBodyDocument)
Private _goodsItem As List(Of FCFCDFBodyGoodsItem)
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._goodsItem = New List(Of FCFCDFBodyGoodsItem)()
Me._document = New List(Of FCFCDFBodyDocument)()
Me._customsValue = New FCFCDFBodyCustomsValue()
Me._foreignTradeStatistics = New FCFCDFBodyForeignTradeStatistics()
Me._paymentTransaction = New FCFCDFBodyPaymentTransaction()
Me._deliveryTerms = New FCFCDFBodyDeliveryTerms()
Me._containers = New FCFCDFBodyContainers()
Me._additionalDutyReferences = New List(Of FCFCDFBodyAdditionalDutyReferences)()
Me._consignee = New FCFCDFBodyConsignee()
Me._consignor = New FCFCDFBodyConsignor()
End Sub
_
Public Property CustomsValueFlag() As String
Get
Return Me._customsValueFlag
End Get
Set
Me._customsValueFlag = value
End Set
End Property
_
Public Property Consignor() As FCFCDFBodyConsignor
Get
Return Me._consignor
End Get
Set
Me._consignor = value
End Set
End Property
_
Public Property Consignee() As FCFCDFBodyConsignee
Get
Return Me._consignee
End Get
Set
Me._consignee = value
End Set
End Property
_
Public Property AdditionalDutyReferences() As List(Of FCFCDFBodyAdditionalDutyReferences)
Get
Return Me._additionalDutyReferences
End Get
Set
Me._additionalDutyReferences = value
End Set
End Property
_
Public Property Containers() As FCFCDFBodyContainers
Get
Return Me._containers
End Get
Set
Me._containers = value
End Set
End Property
_
Public Property DeliveryTerms() As FCFCDFBodyDeliveryTerms
Get
Return Me._deliveryTerms
End Get
Set
Me._deliveryTerms = value
End Set
End Property
_
Public Property PaymentTransaction() As FCFCDFBodyPaymentTransaction
Get
Return Me._paymentTransaction
End Get
Set
Me._paymentTransaction = value
End Set
End Property
_
Public Property ForeignTradeStatistics() As FCFCDFBodyForeignTradeStatistics
Get
Return Me._foreignTradeStatistics
End Get
Set
Me._foreignTradeStatistics = value
End Set
End Property
_
Public Property CustomsValue() As FCFCDFBodyCustomsValue
Get
Return Me._customsValue
End Get
Set
Me._customsValue = value
End Set
End Property
_
Public Property Document() As List(Of FCFCDFBodyDocument)
Get
Return Me._document
End Get
Set
Me._document = value
End Set
End Property
_
Public Property GoodsItem() As List(Of FCFCDFBodyGoodsItem)
Get
Return Me._goodsItem
End Get
Set
Me._goodsItem = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFBody))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFBody object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFBody object
'''
''' string to deserialize
''' Output FCFCDFBody 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 FCFCDFBody, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBody)
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 FCFCDFBody) 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 FCFCDFBody
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFBody)
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 FCFCDFBody
Return CType(SerializerXml.Deserialize(s),FCFCDFBody)
End Function
#End Region
'''
''' Serializes current FCFCDFBody 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFBody object
'''
''' File to load and deserialize
''' Output FCFCDFBody 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFBody, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBody)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFBody, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFBody) 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 FCFCDFBody
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFBody
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFBodyConsignor
#Region "Private fields"
Private _identification As FCFCDFBodyConsignorIdentification
Private _name As String
Private _address As FCFCDFBodyConsignorAddress
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._address = New FCFCDFBodyConsignorAddress()
Me._identification = New FCFCDFBodyConsignorIdentification()
End Sub
_
Public Property Identification() As FCFCDFBodyConsignorIdentification
Get
Return Me._identification
End Get
Set
Me._identification = value
End Set
End Property
_
Public Property Name() As String
Get
Return Me._name
End Get
Set
Me._name = value
End Set
End Property
_
Public Property Address() As FCFCDFBodyConsignorAddress
Get
Return Me._address
End Get
Set
Me._address = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFBodyConsignor))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFBodyConsignor object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFBodyConsignor object
'''
''' string to deserialize
''' Output FCFCDFBodyConsignor 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 FCFCDFBodyConsignor, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBodyConsignor)
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 FCFCDFBodyConsignor) 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 FCFCDFBodyConsignor
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFBodyConsignor)
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 FCFCDFBodyConsignor
Return CType(SerializerXml.Deserialize(s),FCFCDFBodyConsignor)
End Function
#End Region
'''
''' Serializes current FCFCDFBodyConsignor 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFBodyConsignor object
'''
''' File to load and deserialize
''' Output FCFCDFBodyConsignor 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFBodyConsignor, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBodyConsignor)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFBodyConsignor, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFBodyConsignor) 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 FCFCDFBodyConsignor
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFBodyConsignor
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFBodyConsignorIdentification
#Region "Private fields"
Private _referenceNumber As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property ReferenceNumber() As String
Get
Return Me._referenceNumber
End Get
Set
Me._referenceNumber = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFBodyConsignorIdentification))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFBodyConsignorIdentification object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFBodyConsignorIdentification object
'''
''' string to deserialize
''' Output FCFCDFBodyConsignorIdentification 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 FCFCDFBodyConsignorIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBodyConsignorIdentification)
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 FCFCDFBodyConsignorIdentification) 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 FCFCDFBodyConsignorIdentification
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFBodyConsignorIdentification)
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 FCFCDFBodyConsignorIdentification
Return CType(SerializerXml.Deserialize(s),FCFCDFBodyConsignorIdentification)
End Function
#End Region
'''
''' Serializes current FCFCDFBodyConsignorIdentification 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFBodyConsignorIdentification object
'''
''' File to load and deserialize
''' Output FCFCDFBodyConsignorIdentification 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFBodyConsignorIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBodyConsignorIdentification)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFBodyConsignorIdentification, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFBodyConsignorIdentification) 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 FCFCDFBodyConsignorIdentification
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFBodyConsignorIdentification
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFBodyConsignorAddress
#Region "Private fields"
Private _line As String
Private _country As String
Private _postcode As String
Private _city As String
Private _district As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property Line() As String
Get
Return Me._line
End Get
Set
Me._line = value
End Set
End Property
_
Public Property Country() As String
Get
Return Me._country
End Get
Set
Me._country = value
End Set
End Property
_
Public Property Postcode() As String
Get
Return Me._postcode
End Get
Set
Me._postcode = value
End Set
End Property
_
Public Property City() As String
Get
Return Me._city
End Get
Set
Me._city = value
End Set
End Property
_
Public Property District() As String
Get
Return Me._district
End Get
Set
Me._district = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFBodyConsignorAddress))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFBodyConsignorAddress object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFBodyConsignorAddress object
'''
''' string to deserialize
''' Output FCFCDFBodyConsignorAddress 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 FCFCDFBodyConsignorAddress, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBodyConsignorAddress)
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 FCFCDFBodyConsignorAddress) 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 FCFCDFBodyConsignorAddress
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFBodyConsignorAddress)
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 FCFCDFBodyConsignorAddress
Return CType(SerializerXml.Deserialize(s),FCFCDFBodyConsignorAddress)
End Function
#End Region
'''
''' Serializes current FCFCDFBodyConsignorAddress 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFBodyConsignorAddress object
'''
''' File to load and deserialize
''' Output FCFCDFBodyConsignorAddress 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFBodyConsignorAddress, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBodyConsignorAddress)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFBodyConsignorAddress, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFBodyConsignorAddress) 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 FCFCDFBodyConsignorAddress
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFBodyConsignorAddress
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFBodyConsignee
#Region "Private fields"
Private _identification As FCFCDFBodyConsigneeIdentification
Private _name As String
Private _address As FCFCDFBodyConsigneeAddress
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._address = New FCFCDFBodyConsigneeAddress()
Me._identification = New FCFCDFBodyConsigneeIdentification()
End Sub
_
Public Property Identification() As FCFCDFBodyConsigneeIdentification
Get
Return Me._identification
End Get
Set
Me._identification = value
End Set
End Property
_
Public Property Name() As String
Get
Return Me._name
End Get
Set
Me._name = value
End Set
End Property
_
Public Property Address() As FCFCDFBodyConsigneeAddress
Get
Return Me._address
End Get
Set
Me._address = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFBodyConsignee))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFBodyConsignee object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFBodyConsignee object
'''
''' string to deserialize
''' Output FCFCDFBodyConsignee 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 FCFCDFBodyConsignee, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBodyConsignee)
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 FCFCDFBodyConsignee) 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 FCFCDFBodyConsignee
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFBodyConsignee)
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 FCFCDFBodyConsignee
Return CType(SerializerXml.Deserialize(s),FCFCDFBodyConsignee)
End Function
#End Region
'''
''' Serializes current FCFCDFBodyConsignee 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFBodyConsignee object
'''
''' File to load and deserialize
''' Output FCFCDFBodyConsignee 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFBodyConsignee, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBodyConsignee)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFBodyConsignee, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFBodyConsignee) 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 FCFCDFBodyConsignee
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFBodyConsignee
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFBodyConsigneeIdentification
#Region "Private fields"
Private _referenceNumber As String
Private _subsidiaryNumber As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property ReferenceNumber() As String
Get
Return Me._referenceNumber
End Get
Set
Me._referenceNumber = value
End Set
End Property
_
Public Property SubsidiaryNumber() As String
Get
Return Me._subsidiaryNumber
End Get
Set
Me._subsidiaryNumber = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFBodyConsigneeIdentification))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFBodyConsigneeIdentification object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFBodyConsigneeIdentification object
'''
''' string to deserialize
''' Output FCFCDFBodyConsigneeIdentification 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 FCFCDFBodyConsigneeIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBodyConsigneeIdentification)
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 FCFCDFBodyConsigneeIdentification) 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 FCFCDFBodyConsigneeIdentification
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFBodyConsigneeIdentification)
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 FCFCDFBodyConsigneeIdentification
Return CType(SerializerXml.Deserialize(s),FCFCDFBodyConsigneeIdentification)
End Function
#End Region
'''
''' Serializes current FCFCDFBodyConsigneeIdentification 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFBodyConsigneeIdentification object
'''
''' File to load and deserialize
''' Output FCFCDFBodyConsigneeIdentification 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFBodyConsigneeIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBodyConsigneeIdentification)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFBodyConsigneeIdentification, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFBodyConsigneeIdentification) 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 FCFCDFBodyConsigneeIdentification
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFBodyConsigneeIdentification
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFBodyConsigneeAddress
#Region "Private fields"
Private _line As String
Private _country As String
Private _postcode As String
Private _city As String
Private _district As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property Line() As String
Get
Return Me._line
End Get
Set
Me._line = value
End Set
End Property
_
Public Property Country() As String
Get
Return Me._country
End Get
Set
Me._country = value
End Set
End Property
_
Public Property Postcode() As String
Get
Return Me._postcode
End Get
Set
Me._postcode = value
End Set
End Property
_
Public Property City() As String
Get
Return Me._city
End Get
Set
Me._city = value
End Set
End Property
_
Public Property District() As String
Get
Return Me._district
End Get
Set
Me._district = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFBodyConsigneeAddress))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFBodyConsigneeAddress object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFBodyConsigneeAddress object
'''
''' string to deserialize
''' Output FCFCDFBodyConsigneeAddress 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 FCFCDFBodyConsigneeAddress, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBodyConsigneeAddress)
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 FCFCDFBodyConsigneeAddress) 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 FCFCDFBodyConsigneeAddress
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFBodyConsigneeAddress)
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 FCFCDFBodyConsigneeAddress
Return CType(SerializerXml.Deserialize(s),FCFCDFBodyConsigneeAddress)
End Function
#End Region
'''
''' Serializes current FCFCDFBodyConsigneeAddress 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFBodyConsigneeAddress object
'''
''' File to load and deserialize
''' Output FCFCDFBodyConsigneeAddress 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFBodyConsigneeAddress, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBodyConsigneeAddress)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFBodyConsigneeAddress, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFBodyConsigneeAddress) 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 FCFCDFBodyConsigneeAddress
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFBodyConsigneeAddress
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFBodyAdditionalDutyReferences
#Region "Private fields"
Private _referenceNumber As String
Private _dutyInterestedParty As FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._dutyInterestedParty = New FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty()
End Sub
_
Public Property ReferenceNumber() As String
Get
Return Me._referenceNumber
End Get
Set
Me._referenceNumber = value
End Set
End Property
_
Public Property DutyInterestedParty() As FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty
Get
Return Me._dutyInterestedParty
End Get
Set
Me._dutyInterestedParty = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFBodyAdditionalDutyReferences))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFBodyAdditionalDutyReferences object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFBodyAdditionalDutyReferences object
'''
''' string to deserialize
''' Output FCFCDFBodyAdditionalDutyReferences 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 FCFCDFBodyAdditionalDutyReferences, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBodyAdditionalDutyReferences)
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 FCFCDFBodyAdditionalDutyReferences) 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 FCFCDFBodyAdditionalDutyReferences
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFBodyAdditionalDutyReferences)
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 FCFCDFBodyAdditionalDutyReferences
Return CType(SerializerXml.Deserialize(s),FCFCDFBodyAdditionalDutyReferences)
End Function
#End Region
'''
''' Serializes current FCFCDFBodyAdditionalDutyReferences 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFBodyAdditionalDutyReferences object
'''
''' File to load and deserialize
''' Output FCFCDFBodyAdditionalDutyReferences 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFBodyAdditionalDutyReferences, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBodyAdditionalDutyReferences)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFBodyAdditionalDutyReferences, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFBodyAdditionalDutyReferences) 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 FCFCDFBodyAdditionalDutyReferences
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFBodyAdditionalDutyReferences
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty
#Region "Private fields"
Private _identification As FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification
Private _name As String
Private _address As FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._address = New FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress()
Me._identification = New FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification()
End Sub
_
Public Property Identification() As FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification
Get
Return Me._identification
End Get
Set
Me._identification = value
End Set
End Property
_
Public Property Name() As String
Get
Return Me._name
End Get
Set
Me._name = value
End Set
End Property
_
Public Property Address() As FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress
Get
Return Me._address
End Get
Set
Me._address = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty object
'''
''' string to deserialize
''' Output FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty 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 FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty)
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 FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty) 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 FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty)
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 FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty
Return CType(SerializerXml.Deserialize(s),FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty)
End Function
#End Region
'''
''' Serializes current FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty object
'''
''' File to load and deserialize
''' Output FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty) 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 FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFBodyAdditionalDutyReferencesDutyInterestedParty
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification
#Region "Private fields"
Private _referenceNumber As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property ReferenceNumber() As String
Get
Return Me._referenceNumber
End Get
Set
Me._referenceNumber = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification object
'''
''' string to deserialize
''' Output FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification 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 FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification)
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 FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification) 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 FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification)
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 FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification
Return CType(SerializerXml.Deserialize(s),FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification)
End Function
#End Region
'''
''' Serializes current FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification object
'''
''' File to load and deserialize
''' Output FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification) 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 FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyIdentification
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress
#Region "Private fields"
Private _line As String
Private _country As String
Private _postcode As String
Private _city As String
Private _district As String
Private Shared _serializerXml As XmlSerializer
#End Region
_
Public Property Line() As String
Get
Return Me._line
End Get
Set
Me._line = value
End Set
End Property
_
Public Property Country() As String
Get
Return Me._country
End Get
Set
Me._country = value
End Set
End Property
_
Public Property Postcode() As String
Get
Return Me._postcode
End Get
Set
Me._postcode = value
End Set
End Property
_
Public Property City() As String
Get
Return Me._city
End Get
Set
Me._city = value
End Set
End Property
_
Public Property District() As String
Get
Return Me._district
End Get
Set
Me._district = value
End Set
End Property
Private Shared ReadOnly Property SerializerXml() As XmlSerializer
Get
If (_serializerXml Is Nothing) Then
_serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress))
End If
Return _serializerXml
End Get
End Property
#Region "Serialize/Deserialize"
'''
''' Serialize FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress object
'''
''' XML value
Public Overloads Overridable Function Serialize(ByVal encoding As System.Text.Encoding) 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.Encoding = encoding
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
SerializerXml.Serialize(xmlWriter, Me)
memoryStream.Seek(0, SeekOrigin.Begin)
streamReader = New System.IO.StreamReader(memoryStream, encoding)
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
Public Overloads Overridable Function Serialize() As String
Return Serialize(System.Text.Encoding.UTF8)
End Function
'''
''' Deserializes FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress object
'''
''' string to deserialize
''' Output FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress 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 FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress)
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 FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress) 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 FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress
Dim stringReader As System.IO.StringReader = Nothing
Try
stringReader = New System.IO.StringReader(input)
Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress)
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 FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress
Return CType(SerializerXml.Deserialize(s),FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress)
End Function
#End Region
'''
''' Serializes current FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress 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 Overloads Overridable Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
exception = Nothing
Try
SaveToFile(fileName, encoding)
Return true
Catch e As System.Exception
exception = e
Return false
End Try
End Function
Public Overloads Overridable Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
End Function
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String)
SaveToFile(fileName, System.Text.Encoding.UTF8)
End Sub
Public Overloads Overridable Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
Dim streamWriter As System.IO.StreamWriter = Nothing
Try
Dim dataString As String = Serialize(encoding)
streamWriter = New System.IO.StreamWriter(fileName, false, encoding)
streamWriter.WriteLine(dataString)
streamWriter.Close
Finally
If (Not (streamWriter) Is Nothing) Then
streamWriter.Dispose
End If
End Try
End Sub
'''
''' Deserializes xml markup from file into an FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress object
'''
''' File to load and deserialize
''' Output FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress 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, ByVal encoding As System.Text.Encoding, ByRef obj As FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress, ByRef exception As System.Exception) As Boolean
exception = Nothing
obj = CType(Nothing, FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress)
Try
obj = LoadFromFile(fileName, encoding)
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 FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress, ByRef exception As System.Exception) As Boolean
Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress) 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 FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress
Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
End Function
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As FCFCDFBodyAdditionalDutyReferencesDutyInterestedPartyAddress
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, encoding)
Dim dataString As String = sr.ReadToEnd
sr.Close
file.Close
Return Deserialize(dataString)
Finally
If (Not (file) Is Nothing) Then
file.Dispose
End If
If (Not (sr) Is Nothing) Then
sr.Dispose
End If
End Try
End Function
End Class
_
Partial Public Class FCFCDFBodyContainers
#Region "Private fields"
Private _containerFlag As String
Private _container As List(Of FCFCDFBodyContainersContainer)
Private Shared _serializerXml As XmlSerializer
#End Region
Public Sub New()
MyBase.New
Me._container = New List(Of FCFCDFBodyContainersContainer)()
End Sub