'' ------------------------------------------------------------------------------ '' '' Generated by Xsd2Code++. Version 5.0.0.47. www.xsd2code.com '' MIC_ErrorWarningListVisualBasicFalseFalseFalseOnlyIfDifferentFalseNet45AllTrueTrueTrueFalseFalseFalseFalseFalseNoneStartWithUnderscoreFalseFalseFalseFalseFalsePublicTrueFalseFalseFalseFalseFalseFalseFalseFalseTrueTrueTrueFalseTrueSerializeDeserializeSaveToFileLoadFromFileFalseTrueIndent2SpaceFalseFalseUTF8XmlSerializerFalseFalseFalseFalseFalseFalseFalseEntityBaseFalseFalse '' '' ------------------------------------------------------------------------------ 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 MIC_ErrorWarning Partial Public Class ErrorMessages #Region "Private fields" Private _errorMessage As List(Of TErrorMessageType) Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New Me._errorMessage = New List(Of TErrorMessageType)() End Sub Public Property ErrorMessage() As List(Of TErrorMessageType) Get Return Me._errorMessage End Get Set Me._errorMessage = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(ErrorMessages)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current ErrorMessages 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 ErrorMessages object ''' ''' string workflow markup to deserialize ''' Output ErrorMessages 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 ErrorMessages, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ErrorMessages) 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 ErrorMessages) 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 ErrorMessages Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), ErrorMessages) 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 ErrorMessages Return CType(Serializer.Deserialize(s), ErrorMessages) End Function #End Region ''' ''' Serializes current ErrorMessages 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 ErrorMessages object ''' ''' string xml file to load and deserialize ''' Output ErrorMessages 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 ErrorMessages, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ErrorMessages) 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 ErrorMessages) 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 ErrorMessages 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 TErrorMessageType #Region "Private fields" Private _module As String Private _process As String Private _errorCode As String Private _errorDesc As String Private _reference As TReference Private _details As TErrorDetail Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New Me._details = New TErrorDetail() Me._reference = New TReference() End Sub Public Property [module]() As String Get Return Me._module End Get Set Me._module = Value End Set End Property Public Property process() As String Get Return Me._process End Get Set Me._process = Value End Set End Property Public Property errorCode() As String Get Return Me._errorCode End Get Set Me._errorCode = Value End Set End Property Public Property errorDesc() As String Get Return Me._errorDesc End Get Set Me._errorDesc = Value End Set End Property Public Property Reference() As TReference Get Return Me._reference End Get Set Me._reference = Value End Set End Property Public Property Details() As TErrorDetail Get Return Me._details End Get Set Me._details = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TErrorMessageType)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current TErrorMessageType 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 TErrorMessageType object ''' ''' string workflow markup to deserialize ''' Output TErrorMessageType 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 TErrorMessageType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TErrorMessageType) 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 TErrorMessageType) 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 TErrorMessageType Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TErrorMessageType) 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 TErrorMessageType Return CType(Serializer.Deserialize(s), TErrorMessageType) End Function #End Region ''' ''' Serializes current TErrorMessageType 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 TErrorMessageType object ''' ''' string xml file to load and deserialize ''' Output TErrorMessageType 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 TErrorMessageType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TErrorMessageType) 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 TErrorMessageType) 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 TErrorMessageType 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 TReference #Region "Private fields" Private _company As String Private _plant As String Private _correlationId As String Private _referenceType As String Private _referenceSid As Long Private _user As String Private _partnerId As String Private _routeId As String Private Shared sSerializer As XmlSerializer #End Region 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 correlationId() As String Get Return Me._correlationId End Get Set Me._correlationId = 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 Public Property user() As String Get Return Me._user End Get Set Me._user = 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 routeId() As String Get Return Me._routeId End Get Set Me._routeId = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TReference)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current TReference 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 TReference object ''' ''' string workflow markup to deserialize ''' Output TReference 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 TReference, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TReference) 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 TReference) 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 TReference Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TReference) 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 TReference Return CType(Serializer.Deserialize(s), TReference) End Function #End Region ''' ''' Serializes current TReference 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 TReference object ''' ''' string xml file to load and deserialize ''' Output TReference 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 TReference, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TReference) 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 TReference) 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 TReference 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 TErrorDetail #Region "Private fields" Private _timestamp As Date Private _stackTrace As String Private _additionalDetails As List(Of TErrorDetailAdditionalDetails) Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New Me._additionalDetails = New List(Of TErrorDetailAdditionalDetails)() End Sub Public Property timestamp() As Date Get Return Me._timestamp End Get Set Me._timestamp = Value End Set End Property Public Property stackTrace() As String Get Return Me._stackTrace End Get Set Me._stackTrace = Value End Set End Property Public Property additionalDetails() As List(Of TErrorDetailAdditionalDetails) Get Return Me._additionalDetails End Get Set Me._additionalDetails = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TErrorDetail)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current TErrorDetail 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 TErrorDetail object ''' ''' string workflow markup to deserialize ''' Output TErrorDetail 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 TErrorDetail, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TErrorDetail) 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 TErrorDetail) 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 TErrorDetail Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TErrorDetail) 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 TErrorDetail Return CType(Serializer.Deserialize(s), TErrorDetail) End Function #End Region ''' ''' Serializes current TErrorDetail 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 TErrorDetail object ''' ''' string xml file to load and deserialize ''' Output TErrorDetail 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 TErrorDetail, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TErrorDetail) 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 TErrorDetail) 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 TErrorDetail 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 TErrorDetailAdditionalDetails #Region "Private fields" Private _type As String Private _key As String Private _value As String Private Shared sSerializer As XmlSerializer #End Region Public Property type() As String Get Return Me._type End Get Set Me._type = Value End Set End Property 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(TErrorDetailAdditionalDetails)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current TErrorDetailAdditionalDetails 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 TErrorDetailAdditionalDetails object ''' ''' string workflow markup to deserialize ''' Output TErrorDetailAdditionalDetails 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 TErrorDetailAdditionalDetails, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TErrorDetailAdditionalDetails) 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 TErrorDetailAdditionalDetails) 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 TErrorDetailAdditionalDetails Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TErrorDetailAdditionalDetails) 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 TErrorDetailAdditionalDetails Return CType(Serializer.Deserialize(s), TErrorDetailAdditionalDetails) End Function #End Region ''' ''' Serializes current TErrorDetailAdditionalDetails 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 TErrorDetailAdditionalDetails object ''' ''' string xml file to load and deserialize ''' Output TErrorDetailAdditionalDetails 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 TErrorDetailAdditionalDetails, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TErrorDetailAdditionalDetails) 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 TErrorDetailAdditionalDetails) 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 TErrorDetailAdditionalDetails 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 WarningMessages #Region "Private fields" Private _warningMessage As List(Of TErrorMessageType) Private Shared sSerializer As XmlSerializer #End Region Public Sub New() MyBase.New Me._warningMessage = New List(Of TErrorMessageType)() End Sub Public Property WarningMessage() As List(Of TErrorMessageType) Get Return Me._warningMessage End Get Set Me._warningMessage = Value End Set End Property Private Shared ReadOnly Property Serializer() As XmlSerializer Get If (sSerializer Is Nothing) Then sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(WarningMessages)) End If Return sSerializer End Get End Property #Region "Serialize/Deserialize" ''' ''' Serializes current WarningMessages 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 WarningMessages object ''' ''' string workflow markup to deserialize ''' Output WarningMessages 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 WarningMessages, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, WarningMessages) 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 WarningMessages) 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 WarningMessages Dim stringReader As System.IO.StringReader = Nothing Try stringReader = New System.IO.StringReader(input) Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), WarningMessages) 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 WarningMessages Return CType(Serializer.Deserialize(s), WarningMessages) End Function #End Region ''' ''' Serializes current WarningMessages 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 WarningMessages object ''' ''' string xml file to load and deserialize ''' Output WarningMessages 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 WarningMessages, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, WarningMessages) 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 WarningMessages) 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 WarningMessages 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