3100 lines
130 KiB
VB.net
3100 lines
130 KiB
VB.net
'' ------------------------------------------------------------------------------
|
|
'' <auto-generated>
|
|
'' Generated by Xsd2Code++. Version 4.4.0.7
|
|
'' <NameSpace>DETBAE</NameSpace><Collection>List</Collection><codeType>VisualBasic</codeType><EnableDataBinding>False</EnableDataBinding><GenerateCloneMethod>False</GenerateCloneMethod><GenerateDataContracts>False</GenerateDataContracts><DataMemberNameArg>OnlyIfDifferent</DataMemberNameArg><DataMemberOnXmlIgnore>False</DataMemberOnXmlIgnore><CodeBaseTag>Net45</CodeBaseTag><InitializeFields>All</InitializeFields><GenerateUnusedComplexTypes>True</GenerateUnusedComplexTypes><GenerateUnusedSimpleTypes>True</GenerateUnusedSimpleTypes><GenerateXMLAttributes>True</GenerateXMLAttributes><OrderXMLAttrib>False</OrderXMLAttrib><EnableLazyLoading>False</EnableLazyLoading><VirtualProp>False</VirtualProp><PascalCase>False</PascalCase><AutomaticProperties>False</AutomaticProperties><PropNameSpecified>None</PropNameSpecified><PrivateFieldName>StartWithUnderscore</PrivateFieldName><PrivateFieldNamePrefix></PrivateFieldNamePrefix><EnableRestriction>False</EnableRestriction><RestrictionMaxLenght>False</RestrictionMaxLenght><RestrictionRegEx>False</RestrictionRegEx><RestrictionRange>False</RestrictionRange><ValidateProperty>False</ValidateProperty><ClassNamePrefix></ClassNamePrefix><ClassLevel>Public</ClassLevel><PartialClass>True</PartialClass><ClassesInSeparateFiles>False</ClassesInSeparateFiles><ClassesInSeparateFilesDir></ClassesInSeparateFilesDir><TrackingChangesEnable>False</TrackingChangesEnable><GenTrackingClasses>False</GenTrackingClasses><HidePrivateFieldInIDE>False</HidePrivateFieldInIDE><EnableSummaryComment>False</EnableSummaryComment><EnableAppInfoSettings>False</EnableAppInfoSettings><EnableExternalSchemasCache>False</EnableExternalSchemasCache><EnableDebug>False</EnableDebug><EnableWarn>True</EnableWarn><ExcludeImportedTypes>True</ExcludeImportedTypes><ExpandNesteadAttributeGroup>True</ExpandNesteadAttributeGroup><CleanupCode>False</CleanupCode><EnableXmlSerialization>True</EnableXmlSerialization><SerializeMethodName>Serialize</SerializeMethodName><DeserializeMethodName>Deserialize</DeserializeMethodName><SaveToFileMethodName>SaveToFile</SaveToFileMethodName><LoadFromFileMethodName>LoadFromFile</LoadFromFileMethodName><EnableEncoding>False</EnableEncoding><EnableXMLIndent>True</EnableXMLIndent><IndentChar>Indent2Space</IndentChar><NewLineAttr>False</NewLineAttr><OmitXML>False</OmitXML><Encoder>UTF8</Encoder><Serializer>XmlSerializer</Serializer><sspNullable>False</sspNullable><sspString>False</sspString><sspCollection>False</sspCollection><sspComplexType>False</sspComplexType><sspSimpleType>False</sspSimpleType><sspEnumType>False</sspEnumType><XmlSerializerEvent>False</XmlSerializerEvent><BaseClassName>EntityBase</BaseClassName><UseBaseClass>False</UseBaseClass><GenBaseClass>False</GenBaseClass><CustomUsings></CustomUsings><AttributesToExlude></AttributesToExlude>
|
|
'' </auto-generated>
|
|
'' ------------------------------------------------------------------------------
|
|
Imports System
|
|
Imports System.Diagnostics
|
|
Imports System.Xml.Serialization
|
|
Imports System.Collections
|
|
Imports System.Xml.Schema
|
|
Imports System.ComponentModel
|
|
Imports System.IO
|
|
Imports System.Text
|
|
Imports System.Xml
|
|
Imports System.Collections.Generic
|
|
|
|
Namespace DETBAE
|
|
|
|
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
|
|
System.SerializableAttribute(),
|
|
System.Diagnostics.DebuggerStepThroughAttribute(),
|
|
System.ComponentModel.DesignerCategoryAttribute("code"),
|
|
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True),
|
|
System.Xml.Serialization.XmlRootAttribute([Namespace]:="", IsNullable:=False)>
|
|
Partial Public Class DETBAE
|
|
|
|
#Region "Private fields"
|
|
Private _metaData As DETBAEMetaData
|
|
|
|
Private _header As DETBAEHeader
|
|
|
|
Private _authorisedConsignee As DETBAEAuthorisedConsignee
|
|
|
|
Private Shared sSerializer As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._authorisedConsignee = New DETBAEAuthorisedConsignee()
|
|
Me._header = New DETBAEHeader()
|
|
Me._metaData = New DETBAEMetaData()
|
|
End Sub
|
|
|
|
Public Property MetaData() As DETBAEMetaData
|
|
Get
|
|
Return Me._metaData
|
|
End Get
|
|
Set
|
|
Me._metaData = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Header() As DETBAEHeader
|
|
Get
|
|
Return Me._header
|
|
End Get
|
|
Set
|
|
Me._header = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property AuthorisedConsignee() As DETBAEAuthorisedConsignee
|
|
Get
|
|
Return Me._authorisedConsignee
|
|
End Get
|
|
Set
|
|
Me._authorisedConsignee = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property Serializer() As XmlSerializer
|
|
Get
|
|
If (sSerializer Is Nothing) Then
|
|
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAE))
|
|
End If
|
|
Return sSerializer
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serializes current DETBAE object into an XML string
|
|
''' </summary>
|
|
''' <returns>string XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As System.IO.StreamReader = Nothing
|
|
Dim memoryStream As System.IO.MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New System.IO.MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
xmlWriterSettings.Indent = True
|
|
xmlWriterSettings.IndentChars = " "
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
Serializer.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New System.IO.StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
If (Not (streamReader) Is Nothing) Then
|
|
streamReader.Dispose()
|
|
End If
|
|
If (Not (memoryStream) Is Nothing) Then
|
|
memoryStream.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' Deserializes workflow markup into an DETBAE object
|
|
''' </summary>
|
|
''' <param name="input">string workflow markup to deserialize</param>
|
|
''' <param name="obj">Output DETBAE object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAE, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAE)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAE) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As DETBAE
|
|
Dim stringReader As System.IO.StringReader = Nothing
|
|
Try
|
|
stringReader = New System.IO.StringReader(input)
|
|
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAE)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAE
|
|
Return CType(Serializer.Deserialize(s), DETBAE)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DETBAE object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return True
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As System.IO.StreamWriter = Nothing
|
|
Try
|
|
Dim xmlString As String = Serialize()
|
|
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
|
|
streamWriter = xmlFile.CreateText
|
|
streamWriter.WriteLine(xmlString)
|
|
streamWriter.Close()
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose()
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an DETBAE object
|
|
''' </summary>
|
|
''' <param name="fileName">string xml file to load and deserialize</param>
|
|
''' <param name="obj">Output DETBAE object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAE, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAE)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAE) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As DETBAE
|
|
Dim file As System.IO.FileStream = Nothing
|
|
Dim sr As System.IO.StreamReader = Nothing
|
|
Try
|
|
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New System.IO.StreamReader(file)
|
|
Dim xmlString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(xmlString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
|
|
System.SerializableAttribute(),
|
|
System.Diagnostics.DebuggerStepThroughAttribute(),
|
|
System.ComponentModel.DesignerCategoryAttribute("code"),
|
|
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True)>
|
|
Partial Public Class DETBAEMetaData
|
|
|
|
#Region "Private fields"
|
|
Private _preparation As DETBAEMetaDataPreparation
|
|
|
|
Private _interchangeControlReference As String
|
|
|
|
Private _messageReferenceNumber As String
|
|
|
|
Private _messageIdentifier As String
|
|
|
|
Private _messageGroup As DETBAEMetaDataMessageGroup
|
|
|
|
Private _testIndicator As DETBAEMetaDataTestIndicator
|
|
|
|
Private _messageType As DETBAEMetaDataMessageType
|
|
|
|
Private _interchangeSender As DETBAEMetaDataInterchangeSender
|
|
|
|
Private _interchangeRecipient As DETBAEMetaDataInterchangeRecipient
|
|
|
|
Private Shared sSerializer As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._interchangeRecipient = New DETBAEMetaDataInterchangeRecipient()
|
|
Me._interchangeSender = New DETBAEMetaDataInterchangeSender()
|
|
Me._preparation = New DETBAEMetaDataPreparation()
|
|
End Sub
|
|
|
|
Public Property Preparation() As DETBAEMetaDataPreparation
|
|
Get
|
|
Return Me._preparation
|
|
End Get
|
|
Set
|
|
Me._preparation = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="token")>
|
|
Public Property InterchangeControlReference() As String
|
|
Get
|
|
Return Me._interchangeControlReference
|
|
End Get
|
|
Set
|
|
Me._interchangeControlReference = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="integer")>
|
|
Public Property MessageReferenceNumber() As String
|
|
Get
|
|
Return Me._messageReferenceNumber
|
|
End Get
|
|
Set
|
|
Me._messageReferenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="token")>
|
|
Public Property MessageIdentifier() As String
|
|
Get
|
|
Return Me._messageIdentifier
|
|
End Get
|
|
Set
|
|
Me._messageIdentifier = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property MessageGroup() As DETBAEMetaDataMessageGroup
|
|
Get
|
|
Return Me._messageGroup
|
|
End Get
|
|
Set
|
|
Me._messageGroup = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property TestIndicator() As DETBAEMetaDataTestIndicator
|
|
Get
|
|
Return Me._testIndicator
|
|
End Get
|
|
Set
|
|
Me._testIndicator = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property MessageType() As DETBAEMetaDataMessageType
|
|
Get
|
|
Return Me._messageType
|
|
End Get
|
|
Set
|
|
Me._messageType = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property InterchangeSender() As DETBAEMetaDataInterchangeSender
|
|
Get
|
|
Return Me._interchangeSender
|
|
End Get
|
|
Set
|
|
Me._interchangeSender = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property InterchangeRecipient() As DETBAEMetaDataInterchangeRecipient
|
|
Get
|
|
Return Me._interchangeRecipient
|
|
End Get
|
|
Set
|
|
Me._interchangeRecipient = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property Serializer() As XmlSerializer
|
|
Get
|
|
If (sSerializer Is Nothing) Then
|
|
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEMetaData))
|
|
End If
|
|
Return sSerializer
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serializes current DETBAEMetaData object into an XML string
|
|
''' </summary>
|
|
''' <returns>string XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As System.IO.StreamReader = Nothing
|
|
Dim memoryStream As System.IO.MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New System.IO.MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
xmlWriterSettings.Indent = True
|
|
xmlWriterSettings.IndentChars = " "
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
Serializer.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New System.IO.StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
If (Not (streamReader) Is Nothing) Then
|
|
streamReader.Dispose()
|
|
End If
|
|
If (Not (memoryStream) Is Nothing) Then
|
|
memoryStream.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' Deserializes workflow markup into an DETBAEMetaData object
|
|
''' </summary>
|
|
''' <param name="input">string workflow markup to deserialize</param>
|
|
''' <param name="obj">Output DETBAEMetaData object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEMetaData, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEMetaData)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEMetaData) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As DETBAEMetaData
|
|
Dim stringReader As System.IO.StringReader = Nothing
|
|
Try
|
|
stringReader = New System.IO.StringReader(input)
|
|
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEMetaData)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEMetaData
|
|
Return CType(Serializer.Deserialize(s), DETBAEMetaData)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DETBAEMetaData object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return True
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As System.IO.StreamWriter = Nothing
|
|
Try
|
|
Dim xmlString As String = Serialize()
|
|
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
|
|
streamWriter = xmlFile.CreateText
|
|
streamWriter.WriteLine(xmlString)
|
|
streamWriter.Close()
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose()
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an DETBAEMetaData object
|
|
''' </summary>
|
|
''' <param name="fileName">string xml file to load and deserialize</param>
|
|
''' <param name="obj">Output DETBAEMetaData object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEMetaData, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEMetaData)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEMetaData) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As DETBAEMetaData
|
|
Dim file As System.IO.FileStream = Nothing
|
|
Dim sr As System.IO.StreamReader = Nothing
|
|
Try
|
|
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New System.IO.StreamReader(file)
|
|
Dim xmlString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(xmlString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
|
|
System.SerializableAttribute(),
|
|
System.Diagnostics.DebuggerStepThroughAttribute(),
|
|
System.ComponentModel.DesignerCategoryAttribute("code"),
|
|
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True)>
|
|
Partial Public Class DETBAEMetaDataPreparation
|
|
|
|
#Region "Private fields"
|
|
Private _date As Date
|
|
|
|
Private _time As Date
|
|
|
|
Private Shared sSerializer As XmlSerializer
|
|
#End Region
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="date")>
|
|
Public Property [Date]() As Date
|
|
Get
|
|
Return Me._date
|
|
End Get
|
|
Set
|
|
Me._date = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="time")>
|
|
Public Property Time() As Date
|
|
Get
|
|
Return Me._time
|
|
End Get
|
|
Set
|
|
Me._time = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property Serializer() As XmlSerializer
|
|
Get
|
|
If (sSerializer Is Nothing) Then
|
|
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEMetaDataPreparation))
|
|
End If
|
|
Return sSerializer
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serializes current DETBAEMetaDataPreparation object into an XML string
|
|
''' </summary>
|
|
''' <returns>string XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As System.IO.StreamReader = Nothing
|
|
Dim memoryStream As System.IO.MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New System.IO.MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
xmlWriterSettings.Indent = True
|
|
xmlWriterSettings.IndentChars = " "
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
Serializer.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New System.IO.StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
If (Not (streamReader) Is Nothing) Then
|
|
streamReader.Dispose()
|
|
End If
|
|
If (Not (memoryStream) Is Nothing) Then
|
|
memoryStream.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' Deserializes workflow markup into an DETBAEMetaDataPreparation object
|
|
''' </summary>
|
|
''' <param name="input">string workflow markup to deserialize</param>
|
|
''' <param name="obj">Output DETBAEMetaDataPreparation object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEMetaDataPreparation, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEMetaDataPreparation)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEMetaDataPreparation) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As DETBAEMetaDataPreparation
|
|
Dim stringReader As System.IO.StringReader = Nothing
|
|
Try
|
|
stringReader = New System.IO.StringReader(input)
|
|
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEMetaDataPreparation)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEMetaDataPreparation
|
|
Return CType(Serializer.Deserialize(s), DETBAEMetaDataPreparation)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DETBAEMetaDataPreparation object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return True
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As System.IO.StreamWriter = Nothing
|
|
Try
|
|
Dim xmlString As String = Serialize()
|
|
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
|
|
streamWriter = xmlFile.CreateText
|
|
streamWriter.WriteLine(xmlString)
|
|
streamWriter.Close()
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose()
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an DETBAEMetaDataPreparation object
|
|
''' </summary>
|
|
''' <param name="fileName">string xml file to load and deserialize</param>
|
|
''' <param name="obj">Output DETBAEMetaDataPreparation object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEMetaDataPreparation, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEMetaDataPreparation)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEMetaDataPreparation) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As DETBAEMetaDataPreparation
|
|
Dim file As System.IO.FileStream = Nothing
|
|
Dim sr As System.IO.StreamReader = Nothing
|
|
Try
|
|
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New System.IO.StreamReader(file)
|
|
Dim xmlString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(xmlString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
|
|
System.SerializableAttribute(),
|
|
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True)>
|
|
Public Enum DETBAEMetaDataMessageGroup
|
|
|
|
'''<remarks/>
|
|
TBE
|
|
End Enum
|
|
|
|
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
|
|
System.SerializableAttribute(),
|
|
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True)>
|
|
Public Enum DETBAEMetaDataTestIndicator
|
|
|
|
'''<remarks/>
|
|
<System.Xml.Serialization.XmlEnumAttribute("1")>
|
|
Item1
|
|
End Enum
|
|
|
|
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
|
|
System.SerializableAttribute(),
|
|
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True)>
|
|
Public Enum DETBAEMetaDataMessageType
|
|
|
|
'''<remarks/>
|
|
DETBAE
|
|
End Enum
|
|
|
|
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
|
|
System.SerializableAttribute(),
|
|
System.Diagnostics.DebuggerStepThroughAttribute(),
|
|
System.ComponentModel.DesignerCategoryAttribute("code"),
|
|
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True)>
|
|
Partial Public Class DETBAEMetaDataInterchangeSender
|
|
|
|
#Region "Private fields"
|
|
Private _identification As DETBAEMetaDataInterchangeSenderIdentification
|
|
|
|
Private Shared sSerializer As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._identification = New DETBAEMetaDataInterchangeSenderIdentification()
|
|
End Sub
|
|
|
|
Public Property Identification() As DETBAEMetaDataInterchangeSenderIdentification
|
|
Get
|
|
Return Me._identification
|
|
End Get
|
|
Set
|
|
Me._identification = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property Serializer() As XmlSerializer
|
|
Get
|
|
If (sSerializer Is Nothing) Then
|
|
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEMetaDataInterchangeSender))
|
|
End If
|
|
Return sSerializer
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serializes current DETBAEMetaDataInterchangeSender object into an XML string
|
|
''' </summary>
|
|
''' <returns>string XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As System.IO.StreamReader = Nothing
|
|
Dim memoryStream As System.IO.MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New System.IO.MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
xmlWriterSettings.Indent = True
|
|
xmlWriterSettings.IndentChars = " "
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
Serializer.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New System.IO.StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
If (Not (streamReader) Is Nothing) Then
|
|
streamReader.Dispose()
|
|
End If
|
|
If (Not (memoryStream) Is Nothing) Then
|
|
memoryStream.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' Deserializes workflow markup into an DETBAEMetaDataInterchangeSender object
|
|
''' </summary>
|
|
''' <param name="input">string workflow markup to deserialize</param>
|
|
''' <param name="obj">Output DETBAEMetaDataInterchangeSender object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEMetaDataInterchangeSender, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEMetaDataInterchangeSender)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEMetaDataInterchangeSender) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As DETBAEMetaDataInterchangeSender
|
|
Dim stringReader As System.IO.StringReader = Nothing
|
|
Try
|
|
stringReader = New System.IO.StringReader(input)
|
|
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEMetaDataInterchangeSender)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEMetaDataInterchangeSender
|
|
Return CType(Serializer.Deserialize(s), DETBAEMetaDataInterchangeSender)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DETBAEMetaDataInterchangeSender object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return True
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As System.IO.StreamWriter = Nothing
|
|
Try
|
|
Dim xmlString As String = Serialize()
|
|
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
|
|
streamWriter = xmlFile.CreateText
|
|
streamWriter.WriteLine(xmlString)
|
|
streamWriter.Close()
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose()
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an DETBAEMetaDataInterchangeSender object
|
|
''' </summary>
|
|
''' <param name="fileName">string xml file to load and deserialize</param>
|
|
''' <param name="obj">Output DETBAEMetaDataInterchangeSender object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEMetaDataInterchangeSender, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEMetaDataInterchangeSender)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEMetaDataInterchangeSender) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As DETBAEMetaDataInterchangeSender
|
|
Dim file As System.IO.FileStream = Nothing
|
|
Dim sr As System.IO.StreamReader = Nothing
|
|
Try
|
|
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New System.IO.StreamReader(file)
|
|
Dim xmlString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(xmlString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
|
|
System.SerializableAttribute(),
|
|
System.Diagnostics.DebuggerStepThroughAttribute(),
|
|
System.ComponentModel.DesignerCategoryAttribute("code"),
|
|
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True)>
|
|
Partial Public Class DETBAEMetaDataInterchangeSenderIdentification
|
|
|
|
#Region "Private fields"
|
|
Private _referenceNumber As String
|
|
|
|
Private _subsidiaryNumber As String
|
|
|
|
Private Shared sSerializer As XmlSerializer
|
|
#End Region
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="token")>
|
|
Public Property ReferenceNumber() As String
|
|
Get
|
|
Return Me._referenceNumber
|
|
End Get
|
|
Set
|
|
Me._referenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="token")>
|
|
Public Property SubsidiaryNumber() As String
|
|
Get
|
|
Return Me._subsidiaryNumber
|
|
End Get
|
|
Set
|
|
Me._subsidiaryNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property Serializer() As XmlSerializer
|
|
Get
|
|
If (sSerializer Is Nothing) Then
|
|
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEMetaDataInterchangeSenderIdentification))
|
|
End If
|
|
Return sSerializer
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serializes current DETBAEMetaDataInterchangeSenderIdentification object into an XML string
|
|
''' </summary>
|
|
''' <returns>string XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As System.IO.StreamReader = Nothing
|
|
Dim memoryStream As System.IO.MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New System.IO.MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
xmlWriterSettings.Indent = True
|
|
xmlWriterSettings.IndentChars = " "
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
Serializer.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New System.IO.StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
If (Not (streamReader) Is Nothing) Then
|
|
streamReader.Dispose()
|
|
End If
|
|
If (Not (memoryStream) Is Nothing) Then
|
|
memoryStream.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' Deserializes workflow markup into an DETBAEMetaDataInterchangeSenderIdentification object
|
|
''' </summary>
|
|
''' <param name="input">string workflow markup to deserialize</param>
|
|
''' <param name="obj">Output DETBAEMetaDataInterchangeSenderIdentification object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEMetaDataInterchangeSenderIdentification, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEMetaDataInterchangeSenderIdentification)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEMetaDataInterchangeSenderIdentification) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As DETBAEMetaDataInterchangeSenderIdentification
|
|
Dim stringReader As System.IO.StringReader = Nothing
|
|
Try
|
|
stringReader = New System.IO.StringReader(input)
|
|
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEMetaDataInterchangeSenderIdentification)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEMetaDataInterchangeSenderIdentification
|
|
Return CType(Serializer.Deserialize(s), DETBAEMetaDataInterchangeSenderIdentification)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DETBAEMetaDataInterchangeSenderIdentification object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return True
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As System.IO.StreamWriter = Nothing
|
|
Try
|
|
Dim xmlString As String = Serialize()
|
|
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
|
|
streamWriter = xmlFile.CreateText
|
|
streamWriter.WriteLine(xmlString)
|
|
streamWriter.Close()
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose()
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an DETBAEMetaDataInterchangeSenderIdentification object
|
|
''' </summary>
|
|
''' <param name="fileName">string xml file to load and deserialize</param>
|
|
''' <param name="obj">Output DETBAEMetaDataInterchangeSenderIdentification object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEMetaDataInterchangeSenderIdentification, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEMetaDataInterchangeSenderIdentification)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEMetaDataInterchangeSenderIdentification) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As DETBAEMetaDataInterchangeSenderIdentification
|
|
Dim file As System.IO.FileStream = Nothing
|
|
Dim sr As System.IO.StreamReader = Nothing
|
|
Try
|
|
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New System.IO.StreamReader(file)
|
|
Dim xmlString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(xmlString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
|
|
System.SerializableAttribute(),
|
|
System.Diagnostics.DebuggerStepThroughAttribute(),
|
|
System.ComponentModel.DesignerCategoryAttribute("code"),
|
|
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True)>
|
|
Partial Public Class DETBAEMetaDataInterchangeRecipient
|
|
|
|
#Region "Private fields"
|
|
Private _identification As DETBAEMetaDataInterchangeRecipientIdentification
|
|
|
|
Private Shared sSerializer As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._identification = New DETBAEMetaDataInterchangeRecipientIdentification()
|
|
End Sub
|
|
|
|
Public Property Identification() As DETBAEMetaDataInterchangeRecipientIdentification
|
|
Get
|
|
Return Me._identification
|
|
End Get
|
|
Set
|
|
Me._identification = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property Serializer() As XmlSerializer
|
|
Get
|
|
If (sSerializer Is Nothing) Then
|
|
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEMetaDataInterchangeRecipient))
|
|
End If
|
|
Return sSerializer
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serializes current DETBAEMetaDataInterchangeRecipient object into an XML string
|
|
''' </summary>
|
|
''' <returns>string XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As System.IO.StreamReader = Nothing
|
|
Dim memoryStream As System.IO.MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New System.IO.MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
xmlWriterSettings.Indent = True
|
|
xmlWriterSettings.IndentChars = " "
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
Serializer.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New System.IO.StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
If (Not (streamReader) Is Nothing) Then
|
|
streamReader.Dispose()
|
|
End If
|
|
If (Not (memoryStream) Is Nothing) Then
|
|
memoryStream.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' Deserializes workflow markup into an DETBAEMetaDataInterchangeRecipient object
|
|
''' </summary>
|
|
''' <param name="input">string workflow markup to deserialize</param>
|
|
''' <param name="obj">Output DETBAEMetaDataInterchangeRecipient object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEMetaDataInterchangeRecipient, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEMetaDataInterchangeRecipient)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEMetaDataInterchangeRecipient) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As DETBAEMetaDataInterchangeRecipient
|
|
Dim stringReader As System.IO.StringReader = Nothing
|
|
Try
|
|
stringReader = New System.IO.StringReader(input)
|
|
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEMetaDataInterchangeRecipient)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEMetaDataInterchangeRecipient
|
|
Return CType(Serializer.Deserialize(s), DETBAEMetaDataInterchangeRecipient)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DETBAEMetaDataInterchangeRecipient object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return True
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As System.IO.StreamWriter = Nothing
|
|
Try
|
|
Dim xmlString As String = Serialize()
|
|
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
|
|
streamWriter = xmlFile.CreateText
|
|
streamWriter.WriteLine(xmlString)
|
|
streamWriter.Close()
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose()
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an DETBAEMetaDataInterchangeRecipient object
|
|
''' </summary>
|
|
''' <param name="fileName">string xml file to load and deserialize</param>
|
|
''' <param name="obj">Output DETBAEMetaDataInterchangeRecipient object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEMetaDataInterchangeRecipient, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEMetaDataInterchangeRecipient)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEMetaDataInterchangeRecipient) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As DETBAEMetaDataInterchangeRecipient
|
|
Dim file As System.IO.FileStream = Nothing
|
|
Dim sr As System.IO.StreamReader = Nothing
|
|
Try
|
|
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New System.IO.StreamReader(file)
|
|
Dim xmlString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(xmlString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
|
|
System.SerializableAttribute(),
|
|
System.Diagnostics.DebuggerStepThroughAttribute(),
|
|
System.ComponentModel.DesignerCategoryAttribute("code"),
|
|
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True)>
|
|
Partial Public Class DETBAEMetaDataInterchangeRecipientIdentification
|
|
|
|
#Region "Private fields"
|
|
Private _referenceNumber As String
|
|
|
|
Private Shared sSerializer As XmlSerializer
|
|
#End Region
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="token")>
|
|
Public Property ReferenceNumber() As String
|
|
Get
|
|
Return Me._referenceNumber
|
|
End Get
|
|
Set
|
|
Me._referenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property Serializer() As XmlSerializer
|
|
Get
|
|
If (sSerializer Is Nothing) Then
|
|
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEMetaDataInterchangeRecipientIdentification))
|
|
End If
|
|
Return sSerializer
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serializes current DETBAEMetaDataInterchangeRecipientIdentification object into an XML string
|
|
''' </summary>
|
|
''' <returns>string XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As System.IO.StreamReader = Nothing
|
|
Dim memoryStream As System.IO.MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New System.IO.MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
xmlWriterSettings.Indent = True
|
|
xmlWriterSettings.IndentChars = " "
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
Serializer.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New System.IO.StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
If (Not (streamReader) Is Nothing) Then
|
|
streamReader.Dispose()
|
|
End If
|
|
If (Not (memoryStream) Is Nothing) Then
|
|
memoryStream.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' Deserializes workflow markup into an DETBAEMetaDataInterchangeRecipientIdentification object
|
|
''' </summary>
|
|
''' <param name="input">string workflow markup to deserialize</param>
|
|
''' <param name="obj">Output DETBAEMetaDataInterchangeRecipientIdentification object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEMetaDataInterchangeRecipientIdentification, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEMetaDataInterchangeRecipientIdentification)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEMetaDataInterchangeRecipientIdentification) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As DETBAEMetaDataInterchangeRecipientIdentification
|
|
Dim stringReader As System.IO.StringReader = Nothing
|
|
Try
|
|
stringReader = New System.IO.StringReader(input)
|
|
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEMetaDataInterchangeRecipientIdentification)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEMetaDataInterchangeRecipientIdentification
|
|
Return CType(Serializer.Deserialize(s), DETBAEMetaDataInterchangeRecipientIdentification)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DETBAEMetaDataInterchangeRecipientIdentification object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return True
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As System.IO.StreamWriter = Nothing
|
|
Try
|
|
Dim xmlString As String = Serialize()
|
|
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
|
|
streamWriter = xmlFile.CreateText
|
|
streamWriter.WriteLine(xmlString)
|
|
streamWriter.Close()
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose()
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an DETBAEMetaDataInterchangeRecipientIdentification object
|
|
''' </summary>
|
|
''' <param name="fileName">string xml file to load and deserialize</param>
|
|
''' <param name="obj">Output DETBAEMetaDataInterchangeRecipientIdentification object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEMetaDataInterchangeRecipientIdentification, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEMetaDataInterchangeRecipientIdentification)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEMetaDataInterchangeRecipientIdentification) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As DETBAEMetaDataInterchangeRecipientIdentification
|
|
Dim file As System.IO.FileStream = Nothing
|
|
Dim sr As System.IO.StreamReader = Nothing
|
|
Try
|
|
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New System.IO.StreamReader(file)
|
|
Dim xmlString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(xmlString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
|
|
System.SerializableAttribute(),
|
|
System.Diagnostics.DebuggerStepThroughAttribute(),
|
|
System.ComponentModel.DesignerCategoryAttribute("code"),
|
|
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True)>
|
|
Partial Public Class DETBAEHeader
|
|
|
|
#Region "Private fields"
|
|
Private _messageVersion As String
|
|
|
|
Private _referenceNumber As String
|
|
|
|
Private _presentationDate As Date
|
|
|
|
Private _eventFlag As String
|
|
|
|
Private _deliveryPlace As String
|
|
|
|
Private _customsAuthorisation As DETBAEHeaderCustomsAuthorisation
|
|
|
|
Private _authorisationNumber As String
|
|
|
|
Private Shared sSerializer As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._customsAuthorisation = New DETBAEHeaderCustomsAuthorisation()
|
|
End Sub
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="token")>
|
|
Public Property MessageVersion() As String
|
|
Get
|
|
Return Me._messageVersion
|
|
End Get
|
|
Set
|
|
Me._messageVersion = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="token")>
|
|
Public Property ReferenceNumber() As String
|
|
Get
|
|
Return Me._referenceNumber
|
|
End Get
|
|
Set
|
|
Me._referenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="date")>
|
|
Public Property PresentationDate() As Date
|
|
Get
|
|
Return Me._presentationDate
|
|
End Get
|
|
Set
|
|
Me._presentationDate = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="integer")>
|
|
Public Property EventFlag() As String
|
|
Get
|
|
Return Me._eventFlag
|
|
End Get
|
|
Set
|
|
Me._eventFlag = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="token")>
|
|
Public Property DeliveryPlace() As String
|
|
Get
|
|
Return Me._deliveryPlace
|
|
End Get
|
|
Set
|
|
Me._deliveryPlace = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property CustomsAuthorisation() As DETBAEHeaderCustomsAuthorisation
|
|
Get
|
|
Return Me._customsAuthorisation
|
|
End Get
|
|
Set
|
|
Me._customsAuthorisation = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="token")>
|
|
Public Property AuthorisationNumber() As String
|
|
Get
|
|
Return Me._authorisationNumber
|
|
End Get
|
|
Set
|
|
Me._authorisationNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property Serializer() As XmlSerializer
|
|
Get
|
|
If (sSerializer Is Nothing) Then
|
|
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEHeader))
|
|
End If
|
|
Return sSerializer
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serializes current DETBAEHeader object into an XML string
|
|
''' </summary>
|
|
''' <returns>string XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As System.IO.StreamReader = Nothing
|
|
Dim memoryStream As System.IO.MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New System.IO.MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
xmlWriterSettings.Indent = True
|
|
xmlWriterSettings.IndentChars = " "
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
Serializer.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New System.IO.StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
If (Not (streamReader) Is Nothing) Then
|
|
streamReader.Dispose()
|
|
End If
|
|
If (Not (memoryStream) Is Nothing) Then
|
|
memoryStream.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' Deserializes workflow markup into an DETBAEHeader object
|
|
''' </summary>
|
|
''' <param name="input">string workflow markup to deserialize</param>
|
|
''' <param name="obj">Output DETBAEHeader object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEHeader, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEHeader)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEHeader) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As DETBAEHeader
|
|
Dim stringReader As System.IO.StringReader = Nothing
|
|
Try
|
|
stringReader = New System.IO.StringReader(input)
|
|
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEHeader)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEHeader
|
|
Return CType(Serializer.Deserialize(s), DETBAEHeader)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DETBAEHeader object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return True
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As System.IO.StreamWriter = Nothing
|
|
Try
|
|
Dim xmlString As String = Serialize()
|
|
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
|
|
streamWriter = xmlFile.CreateText
|
|
streamWriter.WriteLine(xmlString)
|
|
streamWriter.Close()
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose()
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an DETBAEHeader object
|
|
''' </summary>
|
|
''' <param name="fileName">string xml file to load and deserialize</param>
|
|
''' <param name="obj">Output DETBAEHeader object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEHeader, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEHeader)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEHeader) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As DETBAEHeader
|
|
Dim file As System.IO.FileStream = Nothing
|
|
Dim sr As System.IO.StreamReader = Nothing
|
|
Try
|
|
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New System.IO.StreamReader(file)
|
|
Dim xmlString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(xmlString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
|
|
System.SerializableAttribute(),
|
|
System.Diagnostics.DebuggerStepThroughAttribute(),
|
|
System.ComponentModel.DesignerCategoryAttribute("code"),
|
|
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True)>
|
|
Partial Public Class DETBAEHeaderCustomsAuthorisation
|
|
|
|
#Region "Private fields"
|
|
Private _currentProcedure As String
|
|
|
|
Private Shared sSerializer As XmlSerializer
|
|
#End Region
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="token")>
|
|
Public Property CurrentProcedure() As String
|
|
Get
|
|
Return Me._currentProcedure
|
|
End Get
|
|
Set
|
|
Me._currentProcedure = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property Serializer() As XmlSerializer
|
|
Get
|
|
If (sSerializer Is Nothing) Then
|
|
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEHeaderCustomsAuthorisation))
|
|
End If
|
|
Return sSerializer
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serializes current DETBAEHeaderCustomsAuthorisation object into an XML string
|
|
''' </summary>
|
|
''' <returns>string XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As System.IO.StreamReader = Nothing
|
|
Dim memoryStream As System.IO.MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New System.IO.MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
xmlWriterSettings.Indent = True
|
|
xmlWriterSettings.IndentChars = " "
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
Serializer.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New System.IO.StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
If (Not (streamReader) Is Nothing) Then
|
|
streamReader.Dispose()
|
|
End If
|
|
If (Not (memoryStream) Is Nothing) Then
|
|
memoryStream.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' Deserializes workflow markup into an DETBAEHeaderCustomsAuthorisation object
|
|
''' </summary>
|
|
''' <param name="input">string workflow markup to deserialize</param>
|
|
''' <param name="obj">Output DETBAEHeaderCustomsAuthorisation object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEHeaderCustomsAuthorisation, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEHeaderCustomsAuthorisation)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEHeaderCustomsAuthorisation) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As DETBAEHeaderCustomsAuthorisation
|
|
Dim stringReader As System.IO.StringReader = Nothing
|
|
Try
|
|
stringReader = New System.IO.StringReader(input)
|
|
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEHeaderCustomsAuthorisation)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEHeaderCustomsAuthorisation
|
|
Return CType(Serializer.Deserialize(s), DETBAEHeaderCustomsAuthorisation)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DETBAEHeaderCustomsAuthorisation object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return True
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As System.IO.StreamWriter = Nothing
|
|
Try
|
|
Dim xmlString As String = Serialize()
|
|
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
|
|
streamWriter = xmlFile.CreateText
|
|
streamWriter.WriteLine(xmlString)
|
|
streamWriter.Close()
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose()
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an DETBAEHeaderCustomsAuthorisation object
|
|
''' </summary>
|
|
''' <param name="fileName">string xml file to load and deserialize</param>
|
|
''' <param name="obj">Output DETBAEHeaderCustomsAuthorisation object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEHeaderCustomsAuthorisation, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEHeaderCustomsAuthorisation)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEHeaderCustomsAuthorisation) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As DETBAEHeaderCustomsAuthorisation
|
|
Dim file As System.IO.FileStream = Nothing
|
|
Dim sr As System.IO.StreamReader = Nothing
|
|
Try
|
|
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New System.IO.StreamReader(file)
|
|
Dim xmlString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(xmlString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
|
|
System.SerializableAttribute(),
|
|
System.Diagnostics.DebuggerStepThroughAttribute(),
|
|
System.ComponentModel.DesignerCategoryAttribute("code"),
|
|
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True)>
|
|
Partial Public Class DETBAEAuthorisedConsignee
|
|
|
|
#Region "Private fields"
|
|
Private _class As DETBAEAuthorisedConsigneeClass
|
|
|
|
Private _identification As DETBAEAuthorisedConsigneeIdentification
|
|
|
|
Private _contactPerson As DETBAEAuthorisedConsigneeContactPerson
|
|
|
|
Private Shared sSerializer As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._contactPerson = New DETBAEAuthorisedConsigneeContactPerson()
|
|
Me._identification = New DETBAEAuthorisedConsigneeIdentification()
|
|
End Sub
|
|
|
|
Public Property [Class]() As DETBAEAuthorisedConsigneeClass
|
|
Get
|
|
Return Me._class
|
|
End Get
|
|
Set
|
|
Me._class = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Identification() As DETBAEAuthorisedConsigneeIdentification
|
|
Get
|
|
Return Me._identification
|
|
End Get
|
|
Set
|
|
Me._identification = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property ContactPerson() As DETBAEAuthorisedConsigneeContactPerson
|
|
Get
|
|
Return Me._contactPerson
|
|
End Get
|
|
Set
|
|
Me._contactPerson = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property Serializer() As XmlSerializer
|
|
Get
|
|
If (sSerializer Is Nothing) Then
|
|
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEAuthorisedConsignee))
|
|
End If
|
|
Return sSerializer
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serializes current DETBAEAuthorisedConsignee object into an XML string
|
|
''' </summary>
|
|
''' <returns>string XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As System.IO.StreamReader = Nothing
|
|
Dim memoryStream As System.IO.MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New System.IO.MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
xmlWriterSettings.Indent = True
|
|
xmlWriterSettings.IndentChars = " "
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
Serializer.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New System.IO.StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
If (Not (streamReader) Is Nothing) Then
|
|
streamReader.Dispose()
|
|
End If
|
|
If (Not (memoryStream) Is Nothing) Then
|
|
memoryStream.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' Deserializes workflow markup into an DETBAEAuthorisedConsignee object
|
|
''' </summary>
|
|
''' <param name="input">string workflow markup to deserialize</param>
|
|
''' <param name="obj">Output DETBAEAuthorisedConsignee object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEAuthorisedConsignee, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEAuthorisedConsignee)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEAuthorisedConsignee) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As DETBAEAuthorisedConsignee
|
|
Dim stringReader As System.IO.StringReader = Nothing
|
|
Try
|
|
stringReader = New System.IO.StringReader(input)
|
|
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEAuthorisedConsignee)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEAuthorisedConsignee
|
|
Return CType(Serializer.Deserialize(s), DETBAEAuthorisedConsignee)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DETBAEAuthorisedConsignee object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return True
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As System.IO.StreamWriter = Nothing
|
|
Try
|
|
Dim xmlString As String = Serialize()
|
|
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
|
|
streamWriter = xmlFile.CreateText
|
|
streamWriter.WriteLine(xmlString)
|
|
streamWriter.Close()
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose()
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an DETBAEAuthorisedConsignee object
|
|
''' </summary>
|
|
''' <param name="fileName">string xml file to load and deserialize</param>
|
|
''' <param name="obj">Output DETBAEAuthorisedConsignee object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEAuthorisedConsignee, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEAuthorisedConsignee)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEAuthorisedConsignee) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As DETBAEAuthorisedConsignee
|
|
Dim file As System.IO.FileStream = Nothing
|
|
Dim sr As System.IO.StreamReader = Nothing
|
|
Try
|
|
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New System.IO.StreamReader(file)
|
|
Dim xmlString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(xmlString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
|
|
System.SerializableAttribute(),
|
|
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True)>
|
|
Public Enum DETBAEAuthorisedConsigneeClass
|
|
|
|
'''<remarks/>
|
|
<System.Xml.Serialization.XmlEnumAttribute("2")>
|
|
Item2
|
|
End Enum
|
|
|
|
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
|
|
System.SerializableAttribute(),
|
|
System.Diagnostics.DebuggerStepThroughAttribute(),
|
|
System.ComponentModel.DesignerCategoryAttribute("code"),
|
|
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True)>
|
|
Partial Public Class DETBAEAuthorisedConsigneeIdentification
|
|
|
|
#Region "Private fields"
|
|
Private _referenceNumber As String
|
|
|
|
Private _subsidiaryNumber As String
|
|
|
|
Private Shared sSerializer As XmlSerializer
|
|
#End Region
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="token")>
|
|
Public Property ReferenceNumber() As String
|
|
Get
|
|
Return Me._referenceNumber
|
|
End Get
|
|
Set
|
|
Me._referenceNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="token")>
|
|
Public Property SubsidiaryNumber() As String
|
|
Get
|
|
Return Me._subsidiaryNumber
|
|
End Get
|
|
Set
|
|
Me._subsidiaryNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property Serializer() As XmlSerializer
|
|
Get
|
|
If (sSerializer Is Nothing) Then
|
|
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEAuthorisedConsigneeIdentification))
|
|
End If
|
|
Return sSerializer
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serializes current DETBAEAuthorisedConsigneeIdentification object into an XML string
|
|
''' </summary>
|
|
''' <returns>string XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As System.IO.StreamReader = Nothing
|
|
Dim memoryStream As System.IO.MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New System.IO.MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
xmlWriterSettings.Indent = True
|
|
xmlWriterSettings.IndentChars = " "
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
Serializer.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New System.IO.StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
If (Not (streamReader) Is Nothing) Then
|
|
streamReader.Dispose()
|
|
End If
|
|
If (Not (memoryStream) Is Nothing) Then
|
|
memoryStream.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' Deserializes workflow markup into an DETBAEAuthorisedConsigneeIdentification object
|
|
''' </summary>
|
|
''' <param name="input">string workflow markup to deserialize</param>
|
|
''' <param name="obj">Output DETBAEAuthorisedConsigneeIdentification object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEAuthorisedConsigneeIdentification, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEAuthorisedConsigneeIdentification)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEAuthorisedConsigneeIdentification) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As DETBAEAuthorisedConsigneeIdentification
|
|
Dim stringReader As System.IO.StringReader = Nothing
|
|
Try
|
|
stringReader = New System.IO.StringReader(input)
|
|
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEAuthorisedConsigneeIdentification)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEAuthorisedConsigneeIdentification
|
|
Return CType(Serializer.Deserialize(s), DETBAEAuthorisedConsigneeIdentification)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DETBAEAuthorisedConsigneeIdentification object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return True
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As System.IO.StreamWriter = Nothing
|
|
Try
|
|
Dim xmlString As String = Serialize()
|
|
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
|
|
streamWriter = xmlFile.CreateText
|
|
streamWriter.WriteLine(xmlString)
|
|
streamWriter.Close()
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose()
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an DETBAEAuthorisedConsigneeIdentification object
|
|
''' </summary>
|
|
''' <param name="fileName">string xml file to load and deserialize</param>
|
|
''' <param name="obj">Output DETBAEAuthorisedConsigneeIdentification object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEAuthorisedConsigneeIdentification, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEAuthorisedConsigneeIdentification)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEAuthorisedConsigneeIdentification) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As DETBAEAuthorisedConsigneeIdentification
|
|
Dim file As System.IO.FileStream = Nothing
|
|
Dim sr As System.IO.StreamReader = Nothing
|
|
Try
|
|
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New System.IO.StreamReader(file)
|
|
Dim xmlString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(xmlString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
|
|
System.SerializableAttribute(),
|
|
System.Diagnostics.DebuggerStepThroughAttribute(),
|
|
System.ComponentModel.DesignerCategoryAttribute("code"),
|
|
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True)>
|
|
Partial Public Class DETBAEAuthorisedConsigneeContactPerson
|
|
|
|
#Region "Private fields"
|
|
Private _name As String
|
|
|
|
Private _position As String
|
|
|
|
Private _phoneNumber As String
|
|
|
|
Private _facsimileNumber As String
|
|
|
|
Private _mailAddress As String
|
|
|
|
Private Shared sSerializer As XmlSerializer
|
|
#End Region
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="token")>
|
|
Public Property Name() As String
|
|
Get
|
|
Return Me._name
|
|
End Get
|
|
Set
|
|
Me._name = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="token")>
|
|
Public Property Position() As String
|
|
Get
|
|
Return Me._position
|
|
End Get
|
|
Set
|
|
Me._position = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="token")>
|
|
Public Property PhoneNumber() As String
|
|
Get
|
|
Return Me._phoneNumber
|
|
End Get
|
|
Set
|
|
Me._phoneNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="token")>
|
|
Public Property FacsimileNumber() As String
|
|
Get
|
|
Return Me._facsimileNumber
|
|
End Get
|
|
Set
|
|
Me._facsimileNumber = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.Xml.Serialization.XmlElementAttribute(DataType:="token")>
|
|
Public Property MailAddress() As String
|
|
Get
|
|
Return Me._mailAddress
|
|
End Get
|
|
Set
|
|
Me._mailAddress = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property Serializer() As XmlSerializer
|
|
Get
|
|
If (sSerializer Is Nothing) Then
|
|
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DETBAEAuthorisedConsigneeContactPerson))
|
|
End If
|
|
Return sSerializer
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serializes current DETBAEAuthorisedConsigneeContactPerson object into an XML string
|
|
''' </summary>
|
|
''' <returns>string XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As System.IO.StreamReader = Nothing
|
|
Dim memoryStream As System.IO.MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New System.IO.MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
xmlWriterSettings.Indent = True
|
|
xmlWriterSettings.IndentChars = " "
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
Serializer.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New System.IO.StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
If (Not (streamReader) Is Nothing) Then
|
|
streamReader.Dispose()
|
|
End If
|
|
If (Not (memoryStream) Is Nothing) Then
|
|
memoryStream.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' Deserializes workflow markup into an DETBAEAuthorisedConsigneeContactPerson object
|
|
''' </summary>
|
|
''' <param name="input">string workflow markup to deserialize</param>
|
|
''' <param name="obj">Output DETBAEAuthorisedConsigneeContactPerson object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEAuthorisedConsigneeContactPerson, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEAuthorisedConsigneeContactPerson)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As DETBAEAuthorisedConsigneeContactPerson) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As DETBAEAuthorisedConsigneeContactPerson
|
|
Dim stringReader As System.IO.StringReader = Nothing
|
|
Try
|
|
stringReader = New System.IO.StringReader(input)
|
|
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DETBAEAuthorisedConsigneeContactPerson)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As DETBAEAuthorisedConsigneeContactPerson
|
|
Return CType(Serializer.Deserialize(s), DETBAEAuthorisedConsigneeContactPerson)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current DETBAEAuthorisedConsigneeContactPerson object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return True
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As System.IO.StreamWriter = Nothing
|
|
Try
|
|
Dim xmlString As String = Serialize()
|
|
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
|
|
streamWriter = xmlFile.CreateText
|
|
streamWriter.WriteLine(xmlString)
|
|
streamWriter.Close()
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose()
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an DETBAEAuthorisedConsigneeContactPerson object
|
|
''' </summary>
|
|
''' <param name="fileName">string xml file to load and deserialize</param>
|
|
''' <param name="obj">Output DETBAEAuthorisedConsigneeContactPerson object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEAuthorisedConsigneeContactPerson, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, DETBAEAuthorisedConsigneeContactPerson)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As DETBAEAuthorisedConsigneeContactPerson) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As DETBAEAuthorisedConsigneeContactPerson
|
|
Dim file As System.IO.FileStream = Nothing
|
|
Dim sr As System.IO.StreamReader = Nothing
|
|
Try
|
|
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New System.IO.StreamReader(file)
|
|
Dim xmlString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(xmlString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
|
|
System.SerializableAttribute(),
|
|
System.Diagnostics.DebuggerStepThroughAttribute(),
|
|
System.ComponentModel.DesignerCategoryAttribute("code"),
|
|
System.Xml.Serialization.XmlRootAttribute([Namespace]:="", IsNullable:=True)>
|
|
Partial Public Class [decimal]
|
|
|
|
#Region "Private fields"
|
|
Private _anyAttr As List(Of System.Xml.XmlAttribute)
|
|
|
|
Private _value As Decimal
|
|
|
|
Private Shared sSerializer As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._anyAttr = New List(Of System.Xml.XmlAttribute)()
|
|
End Sub
|
|
|
|
<System.Xml.Serialization.XmlAnyAttributeAttribute()>
|
|
Public Property AnyAttr() As List(Of System.Xml.XmlAttribute)
|
|
Get
|
|
Return Me._anyAttr
|
|
End Get
|
|
Set
|
|
Me._anyAttr = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.Xml.Serialization.XmlTextAttribute()>
|
|
Public Property Value() As Decimal
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property Serializer() As XmlSerializer
|
|
Get
|
|
If (sSerializer Is Nothing) Then
|
|
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType([decimal]))
|
|
End If
|
|
Return sSerializer
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serializes current decimal object into an XML string
|
|
''' </summary>
|
|
''' <returns>string XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As System.IO.StreamReader = Nothing
|
|
Dim memoryStream As System.IO.MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New System.IO.MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
xmlWriterSettings.Indent = True
|
|
xmlWriterSettings.IndentChars = " "
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
Serializer.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New System.IO.StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
If (Not (streamReader) Is Nothing) Then
|
|
streamReader.Dispose()
|
|
End If
|
|
If (Not (memoryStream) Is Nothing) Then
|
|
memoryStream.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' Deserializes workflow markup into an decimal object
|
|
''' </summary>
|
|
''' <param name="input">string workflow markup to deserialize</param>
|
|
''' <param name="obj">Output decimal object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As [decimal], ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, [decimal])
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As [decimal]) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As [decimal]
|
|
Dim stringReader As System.IO.StringReader = Nothing
|
|
Try
|
|
stringReader = New System.IO.StringReader(input)
|
|
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), [decimal])
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As [decimal]
|
|
Return CType(Serializer.Deserialize(s), [decimal])
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current decimal object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return True
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As System.IO.StreamWriter = Nothing
|
|
Try
|
|
Dim xmlString As String = Serialize()
|
|
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
|
|
streamWriter = xmlFile.CreateText
|
|
streamWriter.WriteLine(xmlString)
|
|
streamWriter.Close()
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose()
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an decimal object
|
|
''' </summary>
|
|
''' <param name="fileName">string xml file to load and deserialize</param>
|
|
''' <param name="obj">Output decimal object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As [decimal], ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, [decimal])
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As [decimal]) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As [decimal]
|
|
Dim file As System.IO.FileStream = Nothing
|
|
Dim sr As System.IO.StreamReader = Nothing
|
|
Try
|
|
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New System.IO.StreamReader(file)
|
|
Dim xmlString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(xmlString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
|
|
System.SerializableAttribute(),
|
|
System.Diagnostics.DebuggerStepThroughAttribute(),
|
|
System.ComponentModel.DesignerCategoryAttribute("code"),
|
|
System.Xml.Serialization.XmlRootAttribute([Namespace]:="", IsNullable:=True)>
|
|
Partial Public Class [integer]
|
|
|
|
#Region "Private fields"
|
|
Private _anyAttr As List(Of System.Xml.XmlAttribute)
|
|
|
|
Private _value As String
|
|
|
|
Private Shared sSerializer As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._anyAttr = New List(Of System.Xml.XmlAttribute)()
|
|
End Sub
|
|
|
|
<System.Xml.Serialization.XmlAnyAttributeAttribute()>
|
|
Public Property AnyAttr() As List(Of System.Xml.XmlAttribute)
|
|
Get
|
|
Return Me._anyAttr
|
|
End Get
|
|
Set
|
|
Me._anyAttr = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.Xml.Serialization.XmlTextAttribute(DataType:="integer")>
|
|
Public Property Value() As String
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property Serializer() As XmlSerializer
|
|
Get
|
|
If (sSerializer Is Nothing) Then
|
|
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType([integer]))
|
|
End If
|
|
Return sSerializer
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serializes current integer object into an XML string
|
|
''' </summary>
|
|
''' <returns>string XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As System.IO.StreamReader = Nothing
|
|
Dim memoryStream As System.IO.MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New System.IO.MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
xmlWriterSettings.Indent = True
|
|
xmlWriterSettings.IndentChars = " "
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
Serializer.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New System.IO.StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
If (Not (streamReader) Is Nothing) Then
|
|
streamReader.Dispose()
|
|
End If
|
|
If (Not (memoryStream) Is Nothing) Then
|
|
memoryStream.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' Deserializes workflow markup into an integer object
|
|
''' </summary>
|
|
''' <param name="input">string workflow markup to deserialize</param>
|
|
''' <param name="obj">Output integer object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As [integer], ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, [integer])
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As [integer]) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As [integer]
|
|
Dim stringReader As System.IO.StringReader = Nothing
|
|
Try
|
|
stringReader = New System.IO.StringReader(input)
|
|
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), [integer])
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As [integer]
|
|
Return CType(Serializer.Deserialize(s), [integer])
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current integer object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return True
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As System.IO.StreamWriter = Nothing
|
|
Try
|
|
Dim xmlString As String = Serialize()
|
|
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
|
|
streamWriter = xmlFile.CreateText
|
|
streamWriter.WriteLine(xmlString)
|
|
streamWriter.Close()
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose()
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an integer object
|
|
''' </summary>
|
|
''' <param name="fileName">string xml file to load and deserialize</param>
|
|
''' <param name="obj">Output integer object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As [integer], ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, [integer])
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As [integer]) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As [integer]
|
|
Dim file As System.IO.FileStream = Nothing
|
|
Dim sr As System.IO.StreamReader = Nothing
|
|
Try
|
|
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New System.IO.StreamReader(file)
|
|
Dim xmlString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(xmlString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
|
|
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
|
|
System.SerializableAttribute(),
|
|
System.Diagnostics.DebuggerStepThroughAttribute(),
|
|
System.ComponentModel.DesignerCategoryAttribute("code"),
|
|
System.Xml.Serialization.XmlRootAttribute([Namespace]:="", IsNullable:=True)>
|
|
Partial Public Class token
|
|
|
|
#Region "Private fields"
|
|
Private _anyAttr As List(Of System.Xml.XmlAttribute)
|
|
|
|
Private _value As String
|
|
|
|
Private Shared sSerializer As XmlSerializer
|
|
#End Region
|
|
|
|
Public Sub New()
|
|
MyBase.New
|
|
Me._anyAttr = New List(Of System.Xml.XmlAttribute)()
|
|
End Sub
|
|
|
|
<System.Xml.Serialization.XmlAnyAttributeAttribute()>
|
|
Public Property AnyAttr() As List(Of System.Xml.XmlAttribute)
|
|
Get
|
|
Return Me._anyAttr
|
|
End Get
|
|
Set
|
|
Me._anyAttr = Value
|
|
End Set
|
|
End Property
|
|
|
|
<System.Xml.Serialization.XmlTextAttribute(DataType:="token")>
|
|
Public Property Value() As String
|
|
Get
|
|
Return Me._value
|
|
End Get
|
|
Set
|
|
Me._value = Value
|
|
End Set
|
|
End Property
|
|
|
|
Private Shared ReadOnly Property Serializer() As XmlSerializer
|
|
Get
|
|
If (sSerializer Is Nothing) Then
|
|
sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(token))
|
|
End If
|
|
Return sSerializer
|
|
End Get
|
|
End Property
|
|
|
|
#Region "Serialize/Deserialize"
|
|
''' <summary>
|
|
''' Serializes current token object into an XML string
|
|
''' </summary>
|
|
''' <returns>string XML value</returns>
|
|
Public Overridable Function Serialize() As String
|
|
Dim streamReader As System.IO.StreamReader = Nothing
|
|
Dim memoryStream As System.IO.MemoryStream = Nothing
|
|
Try
|
|
memoryStream = New System.IO.MemoryStream()
|
|
Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
|
|
xmlWriterSettings.Indent = True
|
|
xmlWriterSettings.IndentChars = " "
|
|
Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
|
|
Serializer.Serialize(xmlWriter, Me)
|
|
memoryStream.Seek(0, SeekOrigin.Begin)
|
|
streamReader = New System.IO.StreamReader(memoryStream)
|
|
Return streamReader.ReadToEnd
|
|
Finally
|
|
If (Not (streamReader) Is Nothing) Then
|
|
streamReader.Dispose()
|
|
End If
|
|
If (Not (memoryStream) Is Nothing) Then
|
|
memoryStream.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' Deserializes workflow markup into an token object
|
|
''' </summary>
|
|
''' <param name="input">string workflow markup to deserialize</param>
|
|
''' <param name="obj">Output token object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As token, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, token)
|
|
Try
|
|
obj = Deserialize(input)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As token) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return Deserialize(input, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal input As String) As token
|
|
Dim stringReader As System.IO.StringReader = Nothing
|
|
Try
|
|
stringReader = New System.IO.StringReader(input)
|
|
Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), token)
|
|
Finally
|
|
If (Not (stringReader) Is Nothing) Then
|
|
stringReader.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As token
|
|
Return CType(Serializer.Deserialize(s), token)
|
|
End Function
|
|
#End Region
|
|
|
|
''' <summary>
|
|
''' Serializes current token object into file
|
|
''' </summary>
|
|
''' <param name="fileName">full path of outupt xml file</param>
|
|
''' <param name="exception">output Exception value if failed</param>
|
|
''' <returns>true if can serialize and save into file; otherwise, false</returns>
|
|
Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
Try
|
|
SaveToFile(fileName)
|
|
Return True
|
|
Catch e As System.Exception
|
|
exception = e
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
|
|
Dim streamWriter As System.IO.StreamWriter = Nothing
|
|
Try
|
|
Dim xmlString As String = Serialize()
|
|
Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
|
|
streamWriter = xmlFile.CreateText
|
|
streamWriter.WriteLine(xmlString)
|
|
streamWriter.Close()
|
|
Finally
|
|
If (Not (streamWriter) Is Nothing) Then
|
|
streamWriter.Dispose()
|
|
End If
|
|
End Try
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' Deserializes xml markup from file into an token object
|
|
''' </summary>
|
|
''' <param name="fileName">string xml file to load and deserialize</param>
|
|
''' <param name="obj">Output token object</param>
|
|
''' <param name="exception">output Exception value if deserialize failed</param>
|
|
''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As token, ByRef exception As System.Exception) As Boolean
|
|
exception = Nothing
|
|
obj = CType(Nothing, token)
|
|
Try
|
|
obj = LoadFromFile(fileName)
|
|
Return True
|
|
Catch ex As System.Exception
|
|
exception = ex
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As token) As Boolean
|
|
Dim exception As System.Exception = Nothing
|
|
Return LoadFromFile(fileName, obj, exception)
|
|
End Function
|
|
|
|
Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As token
|
|
Dim file As System.IO.FileStream = Nothing
|
|
Dim sr As System.IO.StreamReader = Nothing
|
|
Try
|
|
file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
|
|
sr = New System.IO.StreamReader(file)
|
|
Dim xmlString As String = sr.ReadToEnd
|
|
sr.Close()
|
|
file.Close()
|
|
Return Deserialize(xmlString)
|
|
Finally
|
|
If (Not (file) Is Nothing) Then
|
|
file.Dispose()
|
|
End If
|
|
If (Not (sr) Is Nothing) Then
|
|
sr.Dispose()
|
|
End If
|
|
End Try
|
|
End Function
|
|
End Class
|
|
End Namespace
|