'' ------------------------------------------------------------------------------
''  <auto-generated>
''    Generated by Xsd2Code++. Version 4.4.0.7
''    <NameSpace>WeitergabeHauptzollamt</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 WeitergabeHauptzollamt

    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.2612.0"), _
     System.SerializableAttribute(), _
     System.Diagnostics.DebuggerStepThroughAttribute(), _
     System.ComponentModel.DesignerCategoryAttribute("code"), _
     System.Xml.Serialization.XmlRootAttribute("WeitergabeHauptzollamt", [Namespace]:="", IsNullable:=False)> _
    Partial Public Class WeiterleitungTRATyp
        Inherits DatenaustauschFreierVerkehrTyp

#Region "Private fields"
        Private _einzelWeiterleitung As EinzelWeiterleitungTyp

        Private Shared sSerializer As XmlSerializer
#End Region

        Public Sub New()
            MyBase.New()
            Me._einzelWeiterleitung = New EinzelWeiterleitungTyp()
        End Sub

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property EinzelWeiterleitung() As EinzelWeiterleitungTyp
            Get
                Return Me._einzelWeiterleitung
            End Get
            Set(value As EinzelWeiterleitungTyp)
                Me._einzelWeiterleitung = Value
            End Set
        End Property

        Private Shared ReadOnly Property Serializer() As XmlSerializer
            Get
                If (sSerializer Is Nothing) Then
                    sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(WeiterleitungTRATyp))
                End If
                Return sSerializer
            End Get
        End Property

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serializes current WeiterleitungTRATyp 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 WeiterleitungTRATyp object
        ''' </summary>
        ''' <param name="input">string workflow markup to deserialize</param>
        ''' <param name="obj">Output WeiterleitungTRATyp 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 WeiterleitungTRATyp, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, WeiterleitungTRATyp)
            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 WeiterleitungTRATyp) 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 WeiterleitungTRATyp
            Dim stringReader As System.IO.StringReader = Nothing
            Try
                stringReader = New System.IO.StringReader(input)
                Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), WeiterleitungTRATyp)
            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 WeiterleitungTRATyp
            Return CType(Serializer.Deserialize(s), WeiterleitungTRATyp)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current WeiterleitungTRATyp 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 WeiterleitungTRATyp object
        ''' </summary>
        ''' <param name="fileName">string xml file to load and deserialize</param>
        ''' <param name="obj">Output WeiterleitungTRATyp 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 WeiterleitungTRATyp, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, WeiterleitungTRATyp)
            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 WeiterleitungTRATyp) 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 WeiterleitungTRATyp
            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.2612.0"), _
     System.SerializableAttribute(), _
     System.Diagnostics.DebuggerStepThroughAttribute(), _
     System.ComponentModel.DesignerCategoryAttribute("code")> _
    Partial Public Class EinzelWeiterleitungTyp

#Region "Private fields"
        Private _objektIdentifizierung As ObjektIdentifizierungTRATyp

        Private _kopfDaten As KopfDatenWeiterleitungTyp

        Private Shared sSerializer As XmlSerializer
#End Region

        Public Sub New()
            MyBase.New()
            Me._kopfDaten = New KopfDatenWeiterleitungTyp()
            Me._objektIdentifizierung = New ObjektIdentifizierungTRATyp()
        End Sub

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property ObjektIdentifizierung() As ObjektIdentifizierungTRATyp
            Get
                Return Me._objektIdentifizierung
            End Get
            Set(value As ObjektIdentifizierungTRATyp)
                Me._objektIdentifizierung = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property KopfDaten() As KopfDatenWeiterleitungTyp
            Get
                Return Me._kopfDaten
            End Get
            Set(value As KopfDatenWeiterleitungTyp)
                Me._kopfDaten = Value
            End Set
        End Property

        Private Shared ReadOnly Property Serializer() As XmlSerializer
            Get
                If (sSerializer Is Nothing) Then
                    sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(EinzelWeiterleitungTyp))
                End If
                Return sSerializer
            End Get
        End Property

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serializes current EinzelWeiterleitungTyp 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 EinzelWeiterleitungTyp object
        ''' </summary>
        ''' <param name="input">string workflow markup to deserialize</param>
        ''' <param name="obj">Output EinzelWeiterleitungTyp 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 EinzelWeiterleitungTyp, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, EinzelWeiterleitungTyp)
            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 EinzelWeiterleitungTyp) 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 EinzelWeiterleitungTyp
            Dim stringReader As System.IO.StringReader = Nothing
            Try
                stringReader = New System.IO.StringReader(input)
                Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), EinzelWeiterleitungTyp)
            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 EinzelWeiterleitungTyp
            Return CType(Serializer.Deserialize(s), EinzelWeiterleitungTyp)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current EinzelWeiterleitungTyp 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 EinzelWeiterleitungTyp object
        ''' </summary>
        ''' <param name="fileName">string xml file to load and deserialize</param>
        ''' <param name="obj">Output EinzelWeiterleitungTyp 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 EinzelWeiterleitungTyp, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, EinzelWeiterleitungTyp)
            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 EinzelWeiterleitungTyp) 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 EinzelWeiterleitungTyp
            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.2612.0"), _
     System.SerializableAttribute(), _
     System.Diagnostics.DebuggerStepThroughAttribute(), _
     System.ComponentModel.DesignerCategoryAttribute("code")> _
    Partial Public Class ObjektIdentifizierungTRATyp

#Region "Private fields"
        Private _objektName As String

        Private _objektAlias As String

        Private _eDIFACTNachrichtenNr As String

        Private _zeitpunktEingang As Date

        Private _shipmentReferenz As String

        Private Shared sSerializer As XmlSerializer
#End Region

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property ObjektName() As String
            Get
                Return Me._objektName
            End Get
            Set(value As String)
                Me._objektName = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property ObjektAlias() As String
            Get
                Return Me._objektAlias
            End Get
            Set(value As String)
                Me._objektAlias = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property EDIFACTNachrichtenNr() As String
            Get
                Return Me._eDIFACTNachrichtenNr
            End Get
            Set(value As String)
                Me._eDIFACTNachrichtenNr = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property ZeitpunktEingang() As Date
            Get
                Return Me._zeitpunktEingang
            End Get
            Set(value As Date)
                Me._zeitpunktEingang = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property ShipmentReferenz() As String
            Get
                Return Me._shipmentReferenz
            End Get
            Set(value As String)
                Me._shipmentReferenz = Value
            End Set
        End Property

        Private Shared ReadOnly Property Serializer() As XmlSerializer
            Get
                If (sSerializer Is Nothing) Then
                    sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(ObjektIdentifizierungTRATyp))
                End If
                Return sSerializer
            End Get
        End Property

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serializes current ObjektIdentifizierungTRATyp 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 ObjektIdentifizierungTRATyp object
        ''' </summary>
        ''' <param name="input">string workflow markup to deserialize</param>
        ''' <param name="obj">Output ObjektIdentifizierungTRATyp 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 ObjektIdentifizierungTRATyp, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, ObjektIdentifizierungTRATyp)
            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 ObjektIdentifizierungTRATyp) 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 ObjektIdentifizierungTRATyp
            Dim stringReader As System.IO.StringReader = Nothing
            Try
                stringReader = New System.IO.StringReader(input)
                Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), ObjektIdentifizierungTRATyp)
            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 ObjektIdentifizierungTRATyp
            Return CType(Serializer.Deserialize(s), ObjektIdentifizierungTRATyp)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current ObjektIdentifizierungTRATyp 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 ObjektIdentifizierungTRATyp object
        ''' </summary>
        ''' <param name="fileName">string xml file to load and deserialize</param>
        ''' <param name="obj">Output ObjektIdentifizierungTRATyp 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 ObjektIdentifizierungTRATyp, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, ObjektIdentifizierungTRATyp)
            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 ObjektIdentifizierungTRATyp) 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 ObjektIdentifizierungTRATyp
            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.2612.0"), _
     System.SerializableAttribute(), _
     System.Diagnostics.DebuggerStepThroughAttribute(), _
     System.ComponentModel.DesignerCategoryAttribute("code")> _
    Partial Public Class KopfDatenWeiterleitungTyp

#Region "Private fields"
        Private _zollBearbeiter As String

        Private _weiterleitungBegruendung As String

        Private _weitergeleiteteZollanmeldungRegistrierNr As String

        Private _weiterleitungDatum As Date

        Private _dienststellenschluessel As String

        Private _hZABezeichnung As String

        Private _hZAOrtS As String

        Private _hZAPLZS As String

        Private _hZAStrasseHausNr As String

        Private _hZAOrtP As String

        Private _hZAPLZP As String

        Private _hZAPostfach As String

        Private Shared sSerializer As XmlSerializer
#End Region

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property ZollBearbeiter() As String
            Get
                Return Me._zollBearbeiter
            End Get
            Set(value As String)
                Me._zollBearbeiter = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property WeiterleitungBegruendung() As String
            Get
                Return Me._weiterleitungBegruendung
            End Get
            Set(value As String)
                Me._weiterleitungBegruendung = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property WeitergeleiteteZollanmeldungRegistrierNr() As String
            Get
                Return Me._weitergeleiteteZollanmeldungRegistrierNr
            End Get
            Set(value As String)
                Me._weitergeleiteteZollanmeldungRegistrierNr = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="date")> _
        Public Property WeiterleitungDatum() As Date
            Get
                Return Me._weiterleitungDatum
            End Get
            Set(value As Date)
                Me._weiterleitungDatum = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="nonNegativeInteger")> _
        Public Property Dienststellenschluessel() As String
            Get
                Return Me._dienststellenschluessel
            End Get
            Set(value As String)
                Me._dienststellenschluessel = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property HZABezeichnung() As String
            Get
                Return Me._hZABezeichnung
            End Get
            Set(value As String)
                Me._hZABezeichnung = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property HZAOrtS() As String
            Get
                Return Me._hZAOrtS
            End Get
            Set(value As String)
                Me._hZAOrtS = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property HZAPLZS() As String
            Get
                Return Me._hZAPLZS
            End Get
            Set(value As String)
                Me._hZAPLZS = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property HZAStrasseHausNr() As String
            Get
                Return Me._hZAStrasseHausNr
            End Get
            Set(value As String)
                Me._hZAStrasseHausNr = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property HZAOrtP() As String
            Get
                Return Me._hZAOrtP
            End Get
            Set(value As String)
                Me._hZAOrtP = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property HZAPLZP() As String
            Get
                Return Me._hZAPLZP
            End Get
            Set(value As String)
                Me._hZAPLZP = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property HZAPostfach() As String
            Get
                Return Me._hZAPostfach
            End Get
            Set(value As String)
                Me._hZAPostfach = Value
            End Set
        End Property

        Private Shared ReadOnly Property Serializer() As XmlSerializer
            Get
                If (sSerializer Is Nothing) Then
                    sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(KopfDatenWeiterleitungTyp))
                End If
                Return sSerializer
            End Get
        End Property

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serializes current KopfDatenWeiterleitungTyp 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 KopfDatenWeiterleitungTyp object
        ''' </summary>
        ''' <param name="input">string workflow markup to deserialize</param>
        ''' <param name="obj">Output KopfDatenWeiterleitungTyp 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 KopfDatenWeiterleitungTyp, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, KopfDatenWeiterleitungTyp)
            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 KopfDatenWeiterleitungTyp) 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 KopfDatenWeiterleitungTyp
            Dim stringReader As System.IO.StringReader = Nothing
            Try
                stringReader = New System.IO.StringReader(input)
                Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), KopfDatenWeiterleitungTyp)
            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 KopfDatenWeiterleitungTyp
            Return CType(Serializer.Deserialize(s), KopfDatenWeiterleitungTyp)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current KopfDatenWeiterleitungTyp 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 KopfDatenWeiterleitungTyp object
        ''' </summary>
        ''' <param name="fileName">string xml file to load and deserialize</param>
        ''' <param name="obj">Output KopfDatenWeiterleitungTyp 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 KopfDatenWeiterleitungTyp, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, KopfDatenWeiterleitungTyp)
            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 KopfDatenWeiterleitungTyp) 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 KopfDatenWeiterleitungTyp
            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.2612.0"), _
     System.SerializableAttribute(), _
     System.Diagnostics.DebuggerStepThroughAttribute(), _
     System.ComponentModel.DesignerCategoryAttribute("code")> _
    Partial Public Class TransaktionFreierVerkehrTyp

#Region "Private fields"
        Private _iOPartner As String

        Private _iODivision1 As String

        Private _iODivision2 As String

        Private _iODivision3 As String

        Private _iOReferenz As String

        Private _iODatumZeit As Date

        Private _version As String

        Private Shared sSerializer As XmlSerializer
#End Region

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property IOPartner() As String
            Get
                Return Me._iOPartner
            End Get
            Set(value As String)
                Me._iOPartner = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property IODivision1() As String
            Get
                Return Me._iODivision1
            End Get
            Set(value As String)
                Me._iODivision1 = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property IODivision2() As String
            Get
                Return Me._iODivision2
            End Get
            Set(value As String)
                Me._iODivision2 = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property IODivision3() As String
            Get
                Return Me._iODivision3
            End Get
            Set(value As String)
                Me._iODivision3 = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property IOReferenz() As String
            Get
                Return Me._iOReferenz
            End Get
            Set(value As String)
                Me._iOReferenz = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property IODatumZeit() As Date
            Get
                Return Me._iODatumZeit
            End Get
            Set(value As Date)
                Me._iODatumZeit = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="nonNegativeInteger")> _
        Public Property Version() As String
            Get
                Return Me._version
            End Get
            Set(value As String)
                Me._version = Value
            End Set
        End Property

        Private Shared ReadOnly Property Serializer() As XmlSerializer
            Get
                If (sSerializer Is Nothing) Then
                    sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TransaktionFreierVerkehrTyp))
                End If
                Return sSerializer
            End Get
        End Property

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serializes current TransaktionFreierVerkehrTyp 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 TransaktionFreierVerkehrTyp object
        ''' </summary>
        ''' <param name="input">string workflow markup to deserialize</param>
        ''' <param name="obj">Output TransaktionFreierVerkehrTyp 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 TransaktionFreierVerkehrTyp, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TransaktionFreierVerkehrTyp)
            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 TransaktionFreierVerkehrTyp) 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 TransaktionFreierVerkehrTyp
            Dim stringReader As System.IO.StringReader = Nothing
            Try
                stringReader = New System.IO.StringReader(input)
                Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TransaktionFreierVerkehrTyp)
            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 TransaktionFreierVerkehrTyp
            Return CType(Serializer.Deserialize(s), TransaktionFreierVerkehrTyp)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current TransaktionFreierVerkehrTyp 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 TransaktionFreierVerkehrTyp object
        ''' </summary>
        ''' <param name="fileName">string xml file to load and deserialize</param>
        ''' <param name="obj">Output TransaktionFreierVerkehrTyp 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 TransaktionFreierVerkehrTyp, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TransaktionFreierVerkehrTyp)
            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 TransaktionFreierVerkehrTyp) 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 TransaktionFreierVerkehrTyp
            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.Xml.Serialization.XmlIncludeAttribute(GetType(WeiterleitungTRATyp)), _
     System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.2612.0"), _
     System.SerializableAttribute(), _
     System.Diagnostics.DebuggerStepThroughAttribute(), _
     System.ComponentModel.DesignerCategoryAttribute("code")> _
    Partial Public Class DatenaustauschFreierVerkehrTyp

#Region "Private fields"
        Private _transaktion As TransaktionFreierVerkehrTyp

        Private Shared sSerializer As XmlSerializer
#End Region

        Public Sub New()
            MyBase.New()
            Me._transaktion = New TransaktionFreierVerkehrTyp()
        End Sub

        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
        Public Property Transaktion() As TransaktionFreierVerkehrTyp
            Get
                Return Me._transaktion
            End Get
            Set(value As TransaktionFreierVerkehrTyp)
                Me._transaktion = Value
            End Set
        End Property

        Private Shared ReadOnly Property Serializer() As XmlSerializer
            Get
                If (sSerializer Is Nothing) Then
                    sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(DatenaustauschFreierVerkehrTyp))
                End If
                Return sSerializer
            End Get
        End Property

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serializes current DatenaustauschFreierVerkehrTyp 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 DatenaustauschFreierVerkehrTyp object
        ''' </summary>
        ''' <param name="input">string workflow markup to deserialize</param>
        ''' <param name="obj">Output DatenaustauschFreierVerkehrTyp 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 DatenaustauschFreierVerkehrTyp, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, DatenaustauschFreierVerkehrTyp)
            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 DatenaustauschFreierVerkehrTyp) 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 DatenaustauschFreierVerkehrTyp
            Dim stringReader As System.IO.StringReader = Nothing
            Try
                stringReader = New System.IO.StringReader(input)
                Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), DatenaustauschFreierVerkehrTyp)
            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 DatenaustauschFreierVerkehrTyp
            Return CType(Serializer.Deserialize(s), DatenaustauschFreierVerkehrTyp)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current DatenaustauschFreierVerkehrTyp 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 DatenaustauschFreierVerkehrTyp object
        ''' </summary>
        ''' <param name="fileName">string xml file to load and deserialize</param>
        ''' <param name="obj">Output DatenaustauschFreierVerkehrTyp 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 DatenaustauschFreierVerkehrTyp, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, DatenaustauschFreierVerkehrTyp)
            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 DatenaustauschFreierVerkehrTyp) 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 DatenaustauschFreierVerkehrTyp
            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
