'' ------------------------------------------------------------------------------ '' '' Generated by Xsd2Code++. Version 5.0.0.47. www.xsd2code.com '' MIC_MetaDataListVisualBasicFalseFalseFalseOnlyIfDifferentFalseNet45AllTrueTrueTrueFalseFalseFalseFalseFalseNoneStartWithUnderscoreFalseFalseFalseFalseFalsePublicTrueFalseFalseFalseFalseFalseFalseFalseFalseTrueTrueTrueFalseTrueSerializeDeserializeSaveToFileLoadFromFileFalseTrueIndent2SpaceFalseFalseUTF8XmlSerializerFalseFalseFalseFalseFalseFalseFalseEntityBaseFalseFalse '' '' ------------------------------------------------------------------------------ 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 Imports VERAG_PROG_ALLGEMEIN.MIC_ErrorWarning Namespace MIC_MetaData Partial Public Class TMicMetadata #Region "Private fields" Private _connectionId As String Private _partnerId As String Private _dateTime As Date Private Shared sSerializer As XmlSerializer #End Region Public Property connectionId() As String Get Return Me._connectionId End Get Set Me._connectionId = Value End Set End Property Public Property partnerId() As String Get Return Me._partnerId End Get Set Me._partnerId = Value End Set End Property Public Property dateTime() As Date Get Return Me._dateTime End Get Set Me._dateTime = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TMicMetadata)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current TMicMetadata object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an TMicMetadata object ''' ''' string workflow markup to deserialize ''' Output TMicMetadata object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMicMetadata, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TMicMetadata) 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 TMicMetadata) 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 TMicMetadata Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TMicMetadata) 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 TMicMetadata Return CType(Serializer.Deserialize(s), TMicMetadata) End Function #End Region ''' ''' Serializes current TMicMetadata object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an TMicMetadata object ''' ''' string xml file to load and deserialize ''' Output TMicMetadata object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMicMetadata, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TMicMetadata) 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 TMicMetadata) 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 TMicMetadata Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class TMessageDetail #Region "Private fields" Private _messageId As String Private _partyId As String Private _transactionId As String Private _sequenceNum As String Private _actionCode As TActionCode Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New Me._actionCode = New TActionCode() End Sub Public Property messageId() As String Get Return Me._messageId End Get Set Me._messageId = Value End Set End Property Public Property partyId() As String Get Return Me._partyId End Get Set Me._partyId = Value End Set End Property Public Property transactionId() As String Get Return Me._transactionId End Get Set Me._transactionId = Value End Set End Property Public Property sequenceNum() As String Get Return Me._sequenceNum End Get Set Me._sequenceNum = Value End Set End Property Public Property ActionCode() As TActionCode Get Return Me._actionCode End Get Set Me._actionCode = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TMessageDetail)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current TMessageDetail object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an TMessageDetail object ''' ''' string workflow markup to deserialize ''' Output TMessageDetail object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMessageDetail, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TMessageDetail) 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 TMessageDetail) 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 TMessageDetail Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TMessageDetail) 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 TMessageDetail Return CType(Serializer.Deserialize(s), TMessageDetail) End Function #End Region ''' ''' Serializes current TMessageDetail object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an TMessageDetail object ''' ''' string xml file to load and deserialize ''' Output TMessageDetail object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMessageDetail, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TMessageDetail) 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 TMessageDetail) 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 TMessageDetail Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class TActionCode #Region "Private fields" Private _code As String Private _parameter As List(Of TActionCodeParameter) Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New Me._parameter = New List(Of TActionCodeParameter)() End Sub Public Property code() As String Get Return Me._code End Get Set Me._code = Value End Set End Property Public Property parameter() As List(Of TActionCodeParameter) Get Return Me._parameter End Get Set Me._parameter = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TActionCode)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current TActionCode object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an TActionCode object ''' ''' string workflow markup to deserialize ''' Output TActionCode object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TActionCode, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TActionCode) 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 TActionCode) 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 TActionCode Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TActionCode) 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 TActionCode Return CType(Serializer.Deserialize(s), TActionCode) End Function #End Region ''' ''' Serializes current TActionCode object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an TActionCode object ''' ''' string xml file to load and deserialize ''' Output TActionCode object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TActionCode, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TActionCode) 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 TActionCode) 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 TActionCode Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class TActionCodeParameter #Region "Private fields" Private _key As String Private _value As String Private Shared sSerializer As XmlSerializer #End Region Public Property key() As String Get Return Me._key End Get Set Me._key = Value End Set End Property Public Property value() As String Get Return Me._value End Get Set Me._value = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TActionCodeParameter)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current TActionCodeParameter object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an TActionCodeParameter object ''' ''' string workflow markup to deserialize ''' Output TActionCodeParameter object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TActionCodeParameter, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TActionCodeParameter) 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 TActionCodeParameter) 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 TActionCodeParameter Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TActionCodeParameter) 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 TActionCodeParameter Return CType(Serializer.Deserialize(s), TActionCodeParameter) End Function #End Region ''' ''' Serializes current TActionCodeParameter object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an TActionCodeParameter object ''' ''' string xml file to load and deserialize ''' Output TActionCodeParameter object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TActionCodeParameter, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TActionCodeParameter) 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 TActionCodeParameter) 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 TActionCodeParameter Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class TStatus #Region "Private fields" Private _status As TStatusStatus Private _item As Object Private _itemElementName As TStatusItemChoiceType Private Shared sSerializer As XmlSerializer #End Region Public Property status() As TStatusStatus Get Return Me._status End Get Set Me._status = Value End Set End Property Public Property Item() As Object Get Return Me._item End Get Set Me._item = Value End Set End Property Public Property ItemElementName() As TStatusItemChoiceType Get Return Me._itemElementName End Get Set Me._itemElementName = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TStatus)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current TStatus object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an TStatus object ''' ''' string workflow markup to deserialize ''' Output TStatus object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TStatus, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TStatus) 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 TStatus) 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 TStatus Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TStatus) 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 TStatus Return CType(Serializer.Deserialize(s), TStatus) End Function #End Region ''' ''' Serializes current TStatus object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an TStatus object ''' ''' string xml file to load and deserialize ''' Output TStatus object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TStatus, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TStatus) 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 TStatus) 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 TStatus Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Public Enum TStatusStatus ''' OK ''' [ERROR] ''' WARNING End Enum Partial Public Class TMetaReference #Region "Private fields" Private _correlationId As String Private _company As String Private _plant As String Private _referenceType As String Private _referenceSid As Long Private Shared sSerializer As XmlSerializer #End Region Public Property correlationId() As String Get Return Me._correlationId End Get Set Me._correlationId = Value End Set End Property Public Property company() As String Get Return Me._company End Get Set Me._company = Value End Set End Property Public Property plant() As String Get Return Me._plant End Get Set Me._plant = Value End Set End Property Public Property referenceType() As String Get Return Me._referenceType End Get Set Me._referenceType = Value End Set End Property Public Property referenceSid() As Long Get Return Me._referenceSid End Get Set Me._referenceSid = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TMetaReference)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current TMetaReference object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an TMetaReference object ''' ''' string workflow markup to deserialize ''' Output TMetaReference object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TMetaReference, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TMetaReference) 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 TMetaReference) 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 TMetaReference Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TMetaReference) 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 TMetaReference Return CType(Serializer.Deserialize(s), TMetaReference) End Function #End Region ''' ''' Serializes current TMetaReference object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an TMetaReference object ''' ''' string xml file to load and deserialize ''' Output TMetaReference object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMetaReference, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TMetaReference) 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 TMetaReference) 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 TMetaReference Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Public Enum TStatusItemChoiceType ''' ErrorMessages ''' WarningMessages ''' Reference End Enum Partial Public Class StatusMessage #Region "Private fields" Private _metadata As TMicMetadata Private _messageDetail As TMessageDetail Private _status As TStatus Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New Me._status = New TStatus() Me._messageDetail = New TMessageDetail() Me._metadata = New TMicMetadata() End Sub Public Property Metadata() As TMicMetadata Get Return Me._metadata End Get Set Me._metadata = Value End Set End Property Public Property MessageDetail() As TMessageDetail Get Return Me._messageDetail End Get Set Me._messageDetail = Value End Set End Property Public Property Status() As TStatus Get Return Me._status End Get Set Me._status = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(StatusMessage)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current StatusMessage object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an StatusMessage object ''' ''' string workflow markup to deserialize ''' Output StatusMessage object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As StatusMessage, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, StatusMessage) 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 StatusMessage) 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 StatusMessage Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), StatusMessage) 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 StatusMessage Return CType(Serializer.Deserialize(s), StatusMessage) End Function #End Region ''' ''' Serializes current StatusMessage object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an StatusMessage object ''' ''' string xml file to load and deserialize ''' Output StatusMessage object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As StatusMessage, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, StatusMessage) 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 StatusMessage) 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 StatusMessage Dim file As System.IO.FileStream = Nothing Dim sr As System.IO.StreamReader = Nothing Try file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) sr = New System.IO.StreamReader(file) Dim xmlString As String = sr.ReadToEnd sr.Close() file.Close() Return Deserialize(xmlString) Finally If (Not (file) Is Nothing) Then file.Dispose() End If If (Not (sr) Is Nothing) Then sr.Dispose() End If End Try End Function End Class Partial Public Class TStatusResponse #Region "Private fields" Private _status As TStatus Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New Me._status = New TStatus() End Sub Public Property Status() As TStatus Get Return Me._status End Get Set Me._status = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TStatusResponse)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current TStatusResponse object into an XML string ''' ''' string XML value Public Overridable Function Serialize() As String Dim streamReader As System.IO.StreamReader = Nothing Dim memoryStream As System.IO.MemoryStream = Nothing Try memoryStream = New System.IO.MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) Serializer.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) streamReader = New System.IO.StreamReader(memoryStream) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then streamReader.Dispose() End If If (Not (memoryStream) Is Nothing) Then memoryStream.Dispose() End If End Try End Function ''' ''' Deserializes workflow markup into an TStatusResponse object ''' ''' string workflow markup to deserialize ''' Output TStatusResponse object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TStatusResponse, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TStatusResponse) 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 TStatusResponse) 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 TStatusResponse Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TStatusResponse) 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 TStatusResponse Return CType(Serializer.Deserialize(s), TStatusResponse) End Function #End Region ''' ''' Serializes current TStatusResponse object into file ''' ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean exception = Nothing Try SaveToFile(fileName) Return True Catch e As System.Exception exception = e Return False End Try End Function Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) Dim streamWriter As System.IO.StreamWriter = Nothing Try Dim xmlString As String = Serialize() Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) streamWriter = xmlFile.CreateText streamWriter.WriteLine(xmlString) streamWriter.Close() Finally If (Not (streamWriter) Is Nothing) Then streamWriter.Dispose() End If End Try End Sub ''' ''' Deserializes xml markup from file into an TStatusResponse object ''' ''' string xml file to load and deserialize ''' Output TStatusResponse object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TStatusResponse, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TStatusResponse) 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 TStatusResponse) 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 TStatusResponse 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