1841 lines
54 KiB
C#
1841 lines
54 KiB
C#
// ------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// Generated by Xsd2Code. Version 3.4.0.32989
|
|
// <NameSpace>bsmd.dbh.response</NameSpace><Collection>List</Collection><codeType>CSharp</codeType><EnableDataBinding>False</EnableDataBinding><EnableLazyLoading>False</EnableLazyLoading><TrackingChangesEnable>False</TrackingChangesEnable><GenTrackingClasses>False</GenTrackingClasses><HidePrivateFieldInIDE>False</HidePrivateFieldInIDE><EnableSummaryComment>False</EnableSummaryComment><VirtualProp>False</VirtualProp><IncludeSerializeMethod>True</IncludeSerializeMethod><UseBaseClass>False</UseBaseClass><GenBaseClass>False</GenBaseClass><GenerateCloneMethod>False</GenerateCloneMethod><GenerateDataContracts>False</GenerateDataContracts><CodeBaseTag>Net40</CodeBaseTag><SerializeMethodName>Serialize</SerializeMethodName><DeserializeMethodName>Deserialize</DeserializeMethodName><SaveToFileMethodName>SaveToFile</SaveToFileMethodName><LoadFromFileMethodName>LoadFromFile</LoadFromFileMethodName><GenerateXMLAttributes>False</GenerateXMLAttributes><OrderXMLAttrib>False</OrderXMLAttrib><EnableEncoding>False</EnableEncoding><AutomaticProperties>False</AutomaticProperties><GenerateShouldSerialize>False</GenerateShouldSerialize><DisableDebug>False</DisableDebug><PropNameSpecified>Default</PropNameSpecified><Encoder>UTF8</Encoder><CustomUsings></CustomUsings><ExcludeIncludedTypes>False</ExcludeIncludedTypes><EnableInitializeFields>True</EnableInitializeFields>
|
|
// </auto-generated>
|
|
// ------------------------------------------------------------------------------
|
|
namespace bsmd.dbh.response
|
|
{
|
|
using System;
|
|
using System.Diagnostics;
|
|
using System.Xml.Serialization;
|
|
using System.Collections;
|
|
using System.Xml.Schema;
|
|
using System.ComponentModel;
|
|
using System.IO;
|
|
using System.Text;
|
|
using System.Collections.Generic;
|
|
|
|
|
|
public partial class Root
|
|
{
|
|
|
|
private string versionField;
|
|
|
|
private string messageIdField;
|
|
|
|
private string visitIdField;
|
|
|
|
private string transitIdField;
|
|
|
|
private System.DateTime timestampField;
|
|
|
|
private string senderField;
|
|
|
|
private string senderReferenceField;
|
|
|
|
private RootType typeField;
|
|
|
|
private RootReportingClassesFull reportingClassesFullField;
|
|
|
|
private RootReportingClassesPartial reportingClassesPartialField;
|
|
|
|
private RootReportingClassesError reportingClassesErrorField;
|
|
|
|
private RootReportingClassesResetted reportingClassesResettedField;
|
|
|
|
private List<RootMessage> messagesField;
|
|
|
|
private static System.Xml.Serialization.XmlSerializer serializer;
|
|
|
|
public Root()
|
|
{
|
|
this.messagesField = new List<RootMessage>();
|
|
this.reportingClassesResettedField = new RootReportingClassesResetted();
|
|
this.reportingClassesErrorField = new RootReportingClassesError();
|
|
this.reportingClassesPartialField = new RootReportingClassesPartial();
|
|
this.reportingClassesFullField = new RootReportingClassesFull();
|
|
}
|
|
|
|
public string Version
|
|
{
|
|
get
|
|
{
|
|
return this.versionField;
|
|
}
|
|
set
|
|
{
|
|
this.versionField = value;
|
|
}
|
|
}
|
|
|
|
public string MessageId
|
|
{
|
|
get
|
|
{
|
|
return this.messageIdField;
|
|
}
|
|
set
|
|
{
|
|
this.messageIdField = value;
|
|
}
|
|
}
|
|
|
|
public string VisitId
|
|
{
|
|
get
|
|
{
|
|
return this.visitIdField;
|
|
}
|
|
set
|
|
{
|
|
this.visitIdField = value;
|
|
}
|
|
}
|
|
|
|
public string TransitId
|
|
{
|
|
get
|
|
{
|
|
return this.transitIdField;
|
|
}
|
|
set
|
|
{
|
|
this.transitIdField = value;
|
|
}
|
|
}
|
|
|
|
public System.DateTime Timestamp
|
|
{
|
|
get
|
|
{
|
|
return this.timestampField;
|
|
}
|
|
set
|
|
{
|
|
this.timestampField = value;
|
|
}
|
|
}
|
|
|
|
public string Sender
|
|
{
|
|
get
|
|
{
|
|
return this.senderField;
|
|
}
|
|
set
|
|
{
|
|
this.senderField = value;
|
|
}
|
|
}
|
|
|
|
public string SenderReference
|
|
{
|
|
get
|
|
{
|
|
return this.senderReferenceField;
|
|
}
|
|
set
|
|
{
|
|
this.senderReferenceField = value;
|
|
}
|
|
}
|
|
|
|
public RootType Type
|
|
{
|
|
get
|
|
{
|
|
return this.typeField;
|
|
}
|
|
set
|
|
{
|
|
this.typeField = value;
|
|
}
|
|
}
|
|
|
|
public RootReportingClassesFull ReportingClassesFull
|
|
{
|
|
get
|
|
{
|
|
return this.reportingClassesFullField;
|
|
}
|
|
set
|
|
{
|
|
this.reportingClassesFullField = value;
|
|
}
|
|
}
|
|
|
|
public RootReportingClassesPartial ReportingClassesPartial
|
|
{
|
|
get
|
|
{
|
|
return this.reportingClassesPartialField;
|
|
}
|
|
set
|
|
{
|
|
this.reportingClassesPartialField = value;
|
|
}
|
|
}
|
|
|
|
public RootReportingClassesError ReportingClassesError
|
|
{
|
|
get
|
|
{
|
|
return this.reportingClassesErrorField;
|
|
}
|
|
set
|
|
{
|
|
this.reportingClassesErrorField = value;
|
|
}
|
|
}
|
|
|
|
public RootReportingClassesResetted ReportingClassesResetted
|
|
{
|
|
get
|
|
{
|
|
return this.reportingClassesResettedField;
|
|
}
|
|
set
|
|
{
|
|
this.reportingClassesResettedField = value;
|
|
}
|
|
}
|
|
|
|
[System.Xml.Serialization.XmlArrayItemAttribute("Message", IsNullable = false)]
|
|
public List<RootMessage> Messages
|
|
{
|
|
get
|
|
{
|
|
return this.messagesField;
|
|
}
|
|
set
|
|
{
|
|
this.messagesField = value;
|
|
}
|
|
}
|
|
|
|
private static System.Xml.Serialization.XmlSerializer Serializer
|
|
{
|
|
get
|
|
{
|
|
if ((serializer == null))
|
|
{
|
|
serializer = new System.Xml.Serialization.XmlSerializer(typeof(Root));
|
|
}
|
|
return serializer;
|
|
}
|
|
}
|
|
|
|
#region Serialize/Deserialize
|
|
/// <summary>
|
|
/// Serializes current Root object into an XML document
|
|
/// </summary>
|
|
/// <returns>string XML value</returns>
|
|
public virtual string Serialize()
|
|
{
|
|
System.IO.StreamReader streamReader = null;
|
|
System.IO.MemoryStream memoryStream = null;
|
|
try
|
|
{
|
|
memoryStream = new System.IO.MemoryStream();
|
|
Serializer.Serialize(memoryStream, this);
|
|
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
|
|
streamReader = new System.IO.StreamReader(memoryStream);
|
|
return streamReader.ReadToEnd();
|
|
}
|
|
finally
|
|
{
|
|
if ((streamReader != null))
|
|
{
|
|
streamReader.Dispose();
|
|
}
|
|
if ((memoryStream != null))
|
|
{
|
|
memoryStream.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Deserializes workflow markup into an Root object
|
|
/// </summary>
|
|
/// <param name="xml">string workflow markup to deserialize</param>
|
|
/// <param name="obj">Output Root object</param>
|
|
/// <param name="exception">output Exception value if deserialize failed</param>
|
|
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
|
|
public static bool Deserialize(string xml, out Root obj, out System.Exception exception)
|
|
{
|
|
exception = null;
|
|
obj = default(Root);
|
|
try
|
|
{
|
|
obj = Deserialize(xml);
|
|
return true;
|
|
}
|
|
catch (System.Exception ex)
|
|
{
|
|
exception = ex;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static bool Deserialize(string xml, out Root obj)
|
|
{
|
|
System.Exception exception = null;
|
|
return Deserialize(xml, out obj, out exception);
|
|
}
|
|
|
|
public static Root Deserialize(string xml)
|
|
{
|
|
System.IO.StringReader stringReader = null;
|
|
try
|
|
{
|
|
stringReader = new System.IO.StringReader(xml);
|
|
return ((Root)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
|
|
}
|
|
finally
|
|
{
|
|
if ((stringReader != null))
|
|
{
|
|
stringReader.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Serializes current Root 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 virtual bool SaveToFile(string fileName, out System.Exception exception)
|
|
{
|
|
exception = null;
|
|
try
|
|
{
|
|
SaveToFile(fileName);
|
|
return true;
|
|
}
|
|
catch (System.Exception e)
|
|
{
|
|
exception = e;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public virtual void SaveToFile(string fileName)
|
|
{
|
|
System.IO.StreamWriter streamWriter = null;
|
|
try
|
|
{
|
|
string xmlString = Serialize();
|
|
System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
|
|
streamWriter = xmlFile.CreateText();
|
|
streamWriter.WriteLine(xmlString);
|
|
streamWriter.Close();
|
|
}
|
|
finally
|
|
{
|
|
if ((streamWriter != null))
|
|
{
|
|
streamWriter.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Deserializes xml markup from file into an Root object
|
|
/// </summary>
|
|
/// <param name="fileName">string xml file to load and deserialize</param>
|
|
/// <param name="obj">Output Root object</param>
|
|
/// <param name="exception">output Exception value if deserialize failed</param>
|
|
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
|
|
public static bool LoadFromFile(string fileName, out Root obj, out System.Exception exception)
|
|
{
|
|
exception = null;
|
|
obj = default(Root);
|
|
try
|
|
{
|
|
obj = LoadFromFile(fileName);
|
|
return true;
|
|
}
|
|
catch (System.Exception ex)
|
|
{
|
|
exception = ex;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static bool LoadFromFile(string fileName, out Root obj)
|
|
{
|
|
System.Exception exception = null;
|
|
return LoadFromFile(fileName, out obj, out exception);
|
|
}
|
|
|
|
public static Root LoadFromFile(string fileName)
|
|
{
|
|
System.IO.FileStream file = null;
|
|
System.IO.StreamReader sr = null;
|
|
try
|
|
{
|
|
file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
|
|
sr = new System.IO.StreamReader(file);
|
|
string xmlString = sr.ReadToEnd();
|
|
sr.Close();
|
|
file.Close();
|
|
return Deserialize(xmlString);
|
|
}
|
|
finally
|
|
{
|
|
if ((file != null))
|
|
{
|
|
file.Dispose();
|
|
}
|
|
if ((sr != null))
|
|
{
|
|
sr.Dispose();
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
|
|
public enum RootType
|
|
{
|
|
|
|
/// <remarks/>
|
|
VISIT,
|
|
|
|
/// <remarks/>
|
|
TRANSIT,
|
|
|
|
/// <remarks/>
|
|
DATA,
|
|
|
|
/// <remarks/>
|
|
RESET,
|
|
|
|
/// <remarks/>
|
|
CANCEL,
|
|
}
|
|
|
|
public partial class RootReportingClassesFull
|
|
{
|
|
|
|
private List<RootReportingClassesFullReportingClass> reportingClassField;
|
|
|
|
private static System.Xml.Serialization.XmlSerializer serializer;
|
|
|
|
public RootReportingClassesFull()
|
|
{
|
|
this.reportingClassField = new List<RootReportingClassesFullReportingClass>();
|
|
}
|
|
|
|
public List<RootReportingClassesFullReportingClass> ReportingClass
|
|
{
|
|
get
|
|
{
|
|
return this.reportingClassField;
|
|
}
|
|
set
|
|
{
|
|
this.reportingClassField = value;
|
|
}
|
|
}
|
|
|
|
private static System.Xml.Serialization.XmlSerializer Serializer
|
|
{
|
|
get
|
|
{
|
|
if ((serializer == null))
|
|
{
|
|
serializer = new System.Xml.Serialization.XmlSerializer(typeof(RootReportingClassesFull));
|
|
}
|
|
return serializer;
|
|
}
|
|
}
|
|
|
|
#region Serialize/Deserialize
|
|
/// <summary>
|
|
/// Serializes current RootReportingClassesFull object into an XML document
|
|
/// </summary>
|
|
/// <returns>string XML value</returns>
|
|
public virtual string Serialize()
|
|
{
|
|
System.IO.StreamReader streamReader = null;
|
|
System.IO.MemoryStream memoryStream = null;
|
|
try
|
|
{
|
|
memoryStream = new System.IO.MemoryStream();
|
|
Serializer.Serialize(memoryStream, this);
|
|
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
|
|
streamReader = new System.IO.StreamReader(memoryStream);
|
|
return streamReader.ReadToEnd();
|
|
}
|
|
finally
|
|
{
|
|
if ((streamReader != null))
|
|
{
|
|
streamReader.Dispose();
|
|
}
|
|
if ((memoryStream != null))
|
|
{
|
|
memoryStream.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Deserializes workflow markup into an RootReportingClassesFull object
|
|
/// </summary>
|
|
/// <param name="xml">string workflow markup to deserialize</param>
|
|
/// <param name="obj">Output RootReportingClassesFull object</param>
|
|
/// <param name="exception">output Exception value if deserialize failed</param>
|
|
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
|
|
public static bool Deserialize(string xml, out RootReportingClassesFull obj, out System.Exception exception)
|
|
{
|
|
exception = null;
|
|
obj = default(RootReportingClassesFull);
|
|
try
|
|
{
|
|
obj = Deserialize(xml);
|
|
return true;
|
|
}
|
|
catch (System.Exception ex)
|
|
{
|
|
exception = ex;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static bool Deserialize(string xml, out RootReportingClassesFull obj)
|
|
{
|
|
System.Exception exception = null;
|
|
return Deserialize(xml, out obj, out exception);
|
|
}
|
|
|
|
public static RootReportingClassesFull Deserialize(string xml)
|
|
{
|
|
System.IO.StringReader stringReader = null;
|
|
try
|
|
{
|
|
stringReader = new System.IO.StringReader(xml);
|
|
return ((RootReportingClassesFull)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
|
|
}
|
|
finally
|
|
{
|
|
if ((stringReader != null))
|
|
{
|
|
stringReader.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Serializes current RootReportingClassesFull 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 virtual bool SaveToFile(string fileName, out System.Exception exception)
|
|
{
|
|
exception = null;
|
|
try
|
|
{
|
|
SaveToFile(fileName);
|
|
return true;
|
|
}
|
|
catch (System.Exception e)
|
|
{
|
|
exception = e;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public virtual void SaveToFile(string fileName)
|
|
{
|
|
System.IO.StreamWriter streamWriter = null;
|
|
try
|
|
{
|
|
string xmlString = Serialize();
|
|
System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
|
|
streamWriter = xmlFile.CreateText();
|
|
streamWriter.WriteLine(xmlString);
|
|
streamWriter.Close();
|
|
}
|
|
finally
|
|
{
|
|
if ((streamWriter != null))
|
|
{
|
|
streamWriter.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Deserializes xml markup from file into an RootReportingClassesFull object
|
|
/// </summary>
|
|
/// <param name="fileName">string xml file to load and deserialize</param>
|
|
/// <param name="obj">Output RootReportingClassesFull object</param>
|
|
/// <param name="exception">output Exception value if deserialize failed</param>
|
|
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
|
|
public static bool LoadFromFile(string fileName, out RootReportingClassesFull obj, out System.Exception exception)
|
|
{
|
|
exception = null;
|
|
obj = default(RootReportingClassesFull);
|
|
try
|
|
{
|
|
obj = LoadFromFile(fileName);
|
|
return true;
|
|
}
|
|
catch (System.Exception ex)
|
|
{
|
|
exception = ex;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static bool LoadFromFile(string fileName, out RootReportingClassesFull obj)
|
|
{
|
|
System.Exception exception = null;
|
|
return LoadFromFile(fileName, out obj, out exception);
|
|
}
|
|
|
|
public static RootReportingClassesFull LoadFromFile(string fileName)
|
|
{
|
|
System.IO.FileStream file = null;
|
|
System.IO.StreamReader sr = null;
|
|
try
|
|
{
|
|
file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
|
|
sr = new System.IO.StreamReader(file);
|
|
string xmlString = sr.ReadToEnd();
|
|
sr.Close();
|
|
file.Close();
|
|
return Deserialize(xmlString);
|
|
}
|
|
finally
|
|
{
|
|
if ((file != null))
|
|
{
|
|
file.Dispose();
|
|
}
|
|
if ((sr != null))
|
|
{
|
|
sr.Dispose();
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
|
|
public enum RootReportingClassesFullReportingClass
|
|
{
|
|
|
|
/// <remarks/>
|
|
NOA_NOD,
|
|
|
|
/// <remarks/>
|
|
ATA,
|
|
|
|
/// <remarks/>
|
|
ATD,
|
|
|
|
/// <remarks/>
|
|
SEC,
|
|
|
|
/// <remarks/>
|
|
POBA,
|
|
|
|
/// <remarks/>
|
|
POBD,
|
|
|
|
/// <remarks/>
|
|
NAME,
|
|
|
|
/// <remarks/>
|
|
TIEFA,
|
|
|
|
/// <remarks/>
|
|
TIEFD,
|
|
|
|
/// <remarks/>
|
|
BKRA,
|
|
|
|
/// <remarks/>
|
|
BKRD,
|
|
|
|
/// <remarks/>
|
|
STAT,
|
|
|
|
/// <remarks/>
|
|
LADG,
|
|
|
|
/// <remarks/>
|
|
INFO,
|
|
|
|
/// <remarks/>
|
|
SERV,
|
|
|
|
/// <remarks/>
|
|
PRE72H,
|
|
|
|
/// <remarks/>
|
|
MDH,
|
|
|
|
/// <remarks/>
|
|
WAS,
|
|
|
|
/// <remarks/>
|
|
CREW,
|
|
|
|
/// <remarks/>
|
|
PAS,
|
|
|
|
/// <remarks/>
|
|
BPOL,
|
|
|
|
/// <remarks/>
|
|
TOWA,
|
|
|
|
/// <remarks/>
|
|
TOWD,
|
|
|
|
/// <remarks/>
|
|
HAZA,
|
|
|
|
/// <remarks/>
|
|
HAZD,
|
|
}
|
|
|
|
public partial class RootReportingClassesPartial
|
|
{
|
|
|
|
private List<RootReportingClassesPartialReportingClass> reportingClassField;
|
|
|
|
private static System.Xml.Serialization.XmlSerializer serializer;
|
|
|
|
public RootReportingClassesPartial()
|
|
{
|
|
this.reportingClassField = new List<RootReportingClassesPartialReportingClass>();
|
|
}
|
|
|
|
public List<RootReportingClassesPartialReportingClass> ReportingClass
|
|
{
|
|
get
|
|
{
|
|
return this.reportingClassField;
|
|
}
|
|
set
|
|
{
|
|
this.reportingClassField = value;
|
|
}
|
|
}
|
|
|
|
private static System.Xml.Serialization.XmlSerializer Serializer
|
|
{
|
|
get
|
|
{
|
|
if ((serializer == null))
|
|
{
|
|
serializer = new System.Xml.Serialization.XmlSerializer(typeof(RootReportingClassesPartial));
|
|
}
|
|
return serializer;
|
|
}
|
|
}
|
|
|
|
#region Serialize/Deserialize
|
|
/// <summary>
|
|
/// Serializes current RootReportingClassesPartial object into an XML document
|
|
/// </summary>
|
|
/// <returns>string XML value</returns>
|
|
public virtual string Serialize()
|
|
{
|
|
System.IO.StreamReader streamReader = null;
|
|
System.IO.MemoryStream memoryStream = null;
|
|
try
|
|
{
|
|
memoryStream = new System.IO.MemoryStream();
|
|
Serializer.Serialize(memoryStream, this);
|
|
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
|
|
streamReader = new System.IO.StreamReader(memoryStream);
|
|
return streamReader.ReadToEnd();
|
|
}
|
|
finally
|
|
{
|
|
if ((streamReader != null))
|
|
{
|
|
streamReader.Dispose();
|
|
}
|
|
if ((memoryStream != null))
|
|
{
|
|
memoryStream.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Deserializes workflow markup into an RootReportingClassesPartial object
|
|
/// </summary>
|
|
/// <param name="xml">string workflow markup to deserialize</param>
|
|
/// <param name="obj">Output RootReportingClassesPartial object</param>
|
|
/// <param name="exception">output Exception value if deserialize failed</param>
|
|
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
|
|
public static bool Deserialize(string xml, out RootReportingClassesPartial obj, out System.Exception exception)
|
|
{
|
|
exception = null;
|
|
obj = default(RootReportingClassesPartial);
|
|
try
|
|
{
|
|
obj = Deserialize(xml);
|
|
return true;
|
|
}
|
|
catch (System.Exception ex)
|
|
{
|
|
exception = ex;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static bool Deserialize(string xml, out RootReportingClassesPartial obj)
|
|
{
|
|
System.Exception exception = null;
|
|
return Deserialize(xml, out obj, out exception);
|
|
}
|
|
|
|
public static RootReportingClassesPartial Deserialize(string xml)
|
|
{
|
|
System.IO.StringReader stringReader = null;
|
|
try
|
|
{
|
|
stringReader = new System.IO.StringReader(xml);
|
|
return ((RootReportingClassesPartial)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
|
|
}
|
|
finally
|
|
{
|
|
if ((stringReader != null))
|
|
{
|
|
stringReader.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Serializes current RootReportingClassesPartial 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 virtual bool SaveToFile(string fileName, out System.Exception exception)
|
|
{
|
|
exception = null;
|
|
try
|
|
{
|
|
SaveToFile(fileName);
|
|
return true;
|
|
}
|
|
catch (System.Exception e)
|
|
{
|
|
exception = e;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public virtual void SaveToFile(string fileName)
|
|
{
|
|
System.IO.StreamWriter streamWriter = null;
|
|
try
|
|
{
|
|
string xmlString = Serialize();
|
|
System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
|
|
streamWriter = xmlFile.CreateText();
|
|
streamWriter.WriteLine(xmlString);
|
|
streamWriter.Close();
|
|
}
|
|
finally
|
|
{
|
|
if ((streamWriter != null))
|
|
{
|
|
streamWriter.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Deserializes xml markup from file into an RootReportingClassesPartial object
|
|
/// </summary>
|
|
/// <param name="fileName">string xml file to load and deserialize</param>
|
|
/// <param name="obj">Output RootReportingClassesPartial object</param>
|
|
/// <param name="exception">output Exception value if deserialize failed</param>
|
|
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
|
|
public static bool LoadFromFile(string fileName, out RootReportingClassesPartial obj, out System.Exception exception)
|
|
{
|
|
exception = null;
|
|
obj = default(RootReportingClassesPartial);
|
|
try
|
|
{
|
|
obj = LoadFromFile(fileName);
|
|
return true;
|
|
}
|
|
catch (System.Exception ex)
|
|
{
|
|
exception = ex;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static bool LoadFromFile(string fileName, out RootReportingClassesPartial obj)
|
|
{
|
|
System.Exception exception = null;
|
|
return LoadFromFile(fileName, out obj, out exception);
|
|
}
|
|
|
|
public static RootReportingClassesPartial LoadFromFile(string fileName)
|
|
{
|
|
System.IO.FileStream file = null;
|
|
System.IO.StreamReader sr = null;
|
|
try
|
|
{
|
|
file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
|
|
sr = new System.IO.StreamReader(file);
|
|
string xmlString = sr.ReadToEnd();
|
|
sr.Close();
|
|
file.Close();
|
|
return Deserialize(xmlString);
|
|
}
|
|
finally
|
|
{
|
|
if ((file != null))
|
|
{
|
|
file.Dispose();
|
|
}
|
|
if ((sr != null))
|
|
{
|
|
sr.Dispose();
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
|
|
public enum RootReportingClassesPartialReportingClass
|
|
{
|
|
|
|
/// <remarks/>
|
|
NOA_NOD,
|
|
|
|
/// <remarks/>
|
|
ATA,
|
|
|
|
/// <remarks/>
|
|
ATD,
|
|
|
|
/// <remarks/>
|
|
SEC,
|
|
|
|
/// <remarks/>
|
|
POBA,
|
|
|
|
/// <remarks/>
|
|
POBD,
|
|
|
|
/// <remarks/>
|
|
NAME,
|
|
|
|
/// <remarks/>
|
|
TIEFA,
|
|
|
|
/// <remarks/>
|
|
TIEFD,
|
|
|
|
/// <remarks/>
|
|
BKRA,
|
|
|
|
/// <remarks/>
|
|
BKRD,
|
|
|
|
/// <remarks/>
|
|
STAT,
|
|
|
|
/// <remarks/>
|
|
LADG,
|
|
|
|
/// <remarks/>
|
|
INFO,
|
|
|
|
/// <remarks/>
|
|
SERV,
|
|
|
|
/// <remarks/>
|
|
PRE72H,
|
|
|
|
/// <remarks/>
|
|
MDH,
|
|
|
|
/// <remarks/>
|
|
WAS,
|
|
|
|
/// <remarks/>
|
|
CREW,
|
|
|
|
/// <remarks/>
|
|
PAS,
|
|
|
|
/// <remarks/>
|
|
BPOL,
|
|
|
|
/// <remarks/>
|
|
TOWA,
|
|
|
|
/// <remarks/>
|
|
TOWD,
|
|
|
|
/// <remarks/>
|
|
HAZA,
|
|
|
|
/// <remarks/>
|
|
HAZD,
|
|
}
|
|
|
|
public partial class RootReportingClassesError
|
|
{
|
|
|
|
private List<RootReportingClassesErrorReportingClass> reportingClassField;
|
|
|
|
private static System.Xml.Serialization.XmlSerializer serializer;
|
|
|
|
public RootReportingClassesError()
|
|
{
|
|
this.reportingClassField = new List<RootReportingClassesErrorReportingClass>();
|
|
}
|
|
|
|
public List<RootReportingClassesErrorReportingClass> ReportingClass
|
|
{
|
|
get
|
|
{
|
|
return this.reportingClassField;
|
|
}
|
|
set
|
|
{
|
|
this.reportingClassField = value;
|
|
}
|
|
}
|
|
|
|
private static System.Xml.Serialization.XmlSerializer Serializer
|
|
{
|
|
get
|
|
{
|
|
if ((serializer == null))
|
|
{
|
|
serializer = new System.Xml.Serialization.XmlSerializer(typeof(RootReportingClassesError));
|
|
}
|
|
return serializer;
|
|
}
|
|
}
|
|
|
|
#region Serialize/Deserialize
|
|
/// <summary>
|
|
/// Serializes current RootReportingClassesError object into an XML document
|
|
/// </summary>
|
|
/// <returns>string XML value</returns>
|
|
public virtual string Serialize()
|
|
{
|
|
System.IO.StreamReader streamReader = null;
|
|
System.IO.MemoryStream memoryStream = null;
|
|
try
|
|
{
|
|
memoryStream = new System.IO.MemoryStream();
|
|
Serializer.Serialize(memoryStream, this);
|
|
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
|
|
streamReader = new System.IO.StreamReader(memoryStream);
|
|
return streamReader.ReadToEnd();
|
|
}
|
|
finally
|
|
{
|
|
if ((streamReader != null))
|
|
{
|
|
streamReader.Dispose();
|
|
}
|
|
if ((memoryStream != null))
|
|
{
|
|
memoryStream.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Deserializes workflow markup into an RootReportingClassesError object
|
|
/// </summary>
|
|
/// <param name="xml">string workflow markup to deserialize</param>
|
|
/// <param name="obj">Output RootReportingClassesError object</param>
|
|
/// <param name="exception">output Exception value if deserialize failed</param>
|
|
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
|
|
public static bool Deserialize(string xml, out RootReportingClassesError obj, out System.Exception exception)
|
|
{
|
|
exception = null;
|
|
obj = default(RootReportingClassesError);
|
|
try
|
|
{
|
|
obj = Deserialize(xml);
|
|
return true;
|
|
}
|
|
catch (System.Exception ex)
|
|
{
|
|
exception = ex;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static bool Deserialize(string xml, out RootReportingClassesError obj)
|
|
{
|
|
System.Exception exception = null;
|
|
return Deserialize(xml, out obj, out exception);
|
|
}
|
|
|
|
public static RootReportingClassesError Deserialize(string xml)
|
|
{
|
|
System.IO.StringReader stringReader = null;
|
|
try
|
|
{
|
|
stringReader = new System.IO.StringReader(xml);
|
|
return ((RootReportingClassesError)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
|
|
}
|
|
finally
|
|
{
|
|
if ((stringReader != null))
|
|
{
|
|
stringReader.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Serializes current RootReportingClassesError 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 virtual bool SaveToFile(string fileName, out System.Exception exception)
|
|
{
|
|
exception = null;
|
|
try
|
|
{
|
|
SaveToFile(fileName);
|
|
return true;
|
|
}
|
|
catch (System.Exception e)
|
|
{
|
|
exception = e;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public virtual void SaveToFile(string fileName)
|
|
{
|
|
System.IO.StreamWriter streamWriter = null;
|
|
try
|
|
{
|
|
string xmlString = Serialize();
|
|
System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
|
|
streamWriter = xmlFile.CreateText();
|
|
streamWriter.WriteLine(xmlString);
|
|
streamWriter.Close();
|
|
}
|
|
finally
|
|
{
|
|
if ((streamWriter != null))
|
|
{
|
|
streamWriter.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Deserializes xml markup from file into an RootReportingClassesError object
|
|
/// </summary>
|
|
/// <param name="fileName">string xml file to load and deserialize</param>
|
|
/// <param name="obj">Output RootReportingClassesError object</param>
|
|
/// <param name="exception">output Exception value if deserialize failed</param>
|
|
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
|
|
public static bool LoadFromFile(string fileName, out RootReportingClassesError obj, out System.Exception exception)
|
|
{
|
|
exception = null;
|
|
obj = default(RootReportingClassesError);
|
|
try
|
|
{
|
|
obj = LoadFromFile(fileName);
|
|
return true;
|
|
}
|
|
catch (System.Exception ex)
|
|
{
|
|
exception = ex;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static bool LoadFromFile(string fileName, out RootReportingClassesError obj)
|
|
{
|
|
System.Exception exception = null;
|
|
return LoadFromFile(fileName, out obj, out exception);
|
|
}
|
|
|
|
public static RootReportingClassesError LoadFromFile(string fileName)
|
|
{
|
|
System.IO.FileStream file = null;
|
|
System.IO.StreamReader sr = null;
|
|
try
|
|
{
|
|
file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
|
|
sr = new System.IO.StreamReader(file);
|
|
string xmlString = sr.ReadToEnd();
|
|
sr.Close();
|
|
file.Close();
|
|
return Deserialize(xmlString);
|
|
}
|
|
finally
|
|
{
|
|
if ((file != null))
|
|
{
|
|
file.Dispose();
|
|
}
|
|
if ((sr != null))
|
|
{
|
|
sr.Dispose();
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
|
|
public enum RootReportingClassesErrorReportingClass
|
|
{
|
|
|
|
/// <remarks/>
|
|
NOA_NOD,
|
|
|
|
/// <remarks/>
|
|
ATA,
|
|
|
|
/// <remarks/>
|
|
ATD,
|
|
|
|
/// <remarks/>
|
|
SEC,
|
|
|
|
/// <remarks/>
|
|
POBA,
|
|
|
|
/// <remarks/>
|
|
POBD,
|
|
|
|
/// <remarks/>
|
|
NAME,
|
|
|
|
/// <remarks/>
|
|
TIEFA,
|
|
|
|
/// <remarks/>
|
|
TIEFD,
|
|
|
|
/// <remarks/>
|
|
BKRA,
|
|
|
|
/// <remarks/>
|
|
BKRD,
|
|
|
|
/// <remarks/>
|
|
STAT,
|
|
|
|
/// <remarks/>
|
|
LADG,
|
|
|
|
/// <remarks/>
|
|
INFO,
|
|
|
|
/// <remarks/>
|
|
SERV,
|
|
|
|
/// <remarks/>
|
|
PRE72H,
|
|
|
|
/// <remarks/>
|
|
MDH,
|
|
|
|
/// <remarks/>
|
|
WAS,
|
|
|
|
/// <remarks/>
|
|
CREW,
|
|
|
|
/// <remarks/>
|
|
PAS,
|
|
|
|
/// <remarks/>
|
|
BPOL,
|
|
|
|
/// <remarks/>
|
|
TOWA,
|
|
|
|
/// <remarks/>
|
|
TOWD,
|
|
|
|
/// <remarks/>
|
|
HAZA,
|
|
|
|
/// <remarks/>
|
|
HAZD,
|
|
}
|
|
|
|
public partial class RootReportingClassesResetted
|
|
{
|
|
|
|
private List<RootReportingClassesResettedReportingClass> reportingClassField;
|
|
|
|
private static System.Xml.Serialization.XmlSerializer serializer;
|
|
|
|
public RootReportingClassesResetted()
|
|
{
|
|
this.reportingClassField = new List<RootReportingClassesResettedReportingClass>();
|
|
}
|
|
|
|
public List<RootReportingClassesResettedReportingClass> ReportingClass
|
|
{
|
|
get
|
|
{
|
|
return this.reportingClassField;
|
|
}
|
|
set
|
|
{
|
|
this.reportingClassField = value;
|
|
}
|
|
}
|
|
|
|
private static System.Xml.Serialization.XmlSerializer Serializer
|
|
{
|
|
get
|
|
{
|
|
if ((serializer == null))
|
|
{
|
|
serializer = new System.Xml.Serialization.XmlSerializer(typeof(RootReportingClassesResetted));
|
|
}
|
|
return serializer;
|
|
}
|
|
}
|
|
|
|
#region Serialize/Deserialize
|
|
/// <summary>
|
|
/// Serializes current RootReportingClassesResetted object into an XML document
|
|
/// </summary>
|
|
/// <returns>string XML value</returns>
|
|
public virtual string Serialize()
|
|
{
|
|
System.IO.StreamReader streamReader = null;
|
|
System.IO.MemoryStream memoryStream = null;
|
|
try
|
|
{
|
|
memoryStream = new System.IO.MemoryStream();
|
|
Serializer.Serialize(memoryStream, this);
|
|
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
|
|
streamReader = new System.IO.StreamReader(memoryStream);
|
|
return streamReader.ReadToEnd();
|
|
}
|
|
finally
|
|
{
|
|
if ((streamReader != null))
|
|
{
|
|
streamReader.Dispose();
|
|
}
|
|
if ((memoryStream != null))
|
|
{
|
|
memoryStream.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Deserializes workflow markup into an RootReportingClassesResetted object
|
|
/// </summary>
|
|
/// <param name="xml">string workflow markup to deserialize</param>
|
|
/// <param name="obj">Output RootReportingClassesResetted object</param>
|
|
/// <param name="exception">output Exception value if deserialize failed</param>
|
|
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
|
|
public static bool Deserialize(string xml, out RootReportingClassesResetted obj, out System.Exception exception)
|
|
{
|
|
exception = null;
|
|
obj = default(RootReportingClassesResetted);
|
|
try
|
|
{
|
|
obj = Deserialize(xml);
|
|
return true;
|
|
}
|
|
catch (System.Exception ex)
|
|
{
|
|
exception = ex;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static bool Deserialize(string xml, out RootReportingClassesResetted obj)
|
|
{
|
|
System.Exception exception = null;
|
|
return Deserialize(xml, out obj, out exception);
|
|
}
|
|
|
|
public static RootReportingClassesResetted Deserialize(string xml)
|
|
{
|
|
System.IO.StringReader stringReader = null;
|
|
try
|
|
{
|
|
stringReader = new System.IO.StringReader(xml);
|
|
return ((RootReportingClassesResetted)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
|
|
}
|
|
finally
|
|
{
|
|
if ((stringReader != null))
|
|
{
|
|
stringReader.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Serializes current RootReportingClassesResetted 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 virtual bool SaveToFile(string fileName, out System.Exception exception)
|
|
{
|
|
exception = null;
|
|
try
|
|
{
|
|
SaveToFile(fileName);
|
|
return true;
|
|
}
|
|
catch (System.Exception e)
|
|
{
|
|
exception = e;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public virtual void SaveToFile(string fileName)
|
|
{
|
|
System.IO.StreamWriter streamWriter = null;
|
|
try
|
|
{
|
|
string xmlString = Serialize();
|
|
System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
|
|
streamWriter = xmlFile.CreateText();
|
|
streamWriter.WriteLine(xmlString);
|
|
streamWriter.Close();
|
|
}
|
|
finally
|
|
{
|
|
if ((streamWriter != null))
|
|
{
|
|
streamWriter.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Deserializes xml markup from file into an RootReportingClassesResetted object
|
|
/// </summary>
|
|
/// <param name="fileName">string xml file to load and deserialize</param>
|
|
/// <param name="obj">Output RootReportingClassesResetted object</param>
|
|
/// <param name="exception">output Exception value if deserialize failed</param>
|
|
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
|
|
public static bool LoadFromFile(string fileName, out RootReportingClassesResetted obj, out System.Exception exception)
|
|
{
|
|
exception = null;
|
|
obj = default(RootReportingClassesResetted);
|
|
try
|
|
{
|
|
obj = LoadFromFile(fileName);
|
|
return true;
|
|
}
|
|
catch (System.Exception ex)
|
|
{
|
|
exception = ex;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static bool LoadFromFile(string fileName, out RootReportingClassesResetted obj)
|
|
{
|
|
System.Exception exception = null;
|
|
return LoadFromFile(fileName, out obj, out exception);
|
|
}
|
|
|
|
public static RootReportingClassesResetted LoadFromFile(string fileName)
|
|
{
|
|
System.IO.FileStream file = null;
|
|
System.IO.StreamReader sr = null;
|
|
try
|
|
{
|
|
file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
|
|
sr = new System.IO.StreamReader(file);
|
|
string xmlString = sr.ReadToEnd();
|
|
sr.Close();
|
|
file.Close();
|
|
return Deserialize(xmlString);
|
|
}
|
|
finally
|
|
{
|
|
if ((file != null))
|
|
{
|
|
file.Dispose();
|
|
}
|
|
if ((sr != null))
|
|
{
|
|
sr.Dispose();
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
|
|
public enum RootReportingClassesResettedReportingClass
|
|
{
|
|
|
|
/// <remarks/>
|
|
NOA_NOD,
|
|
|
|
/// <remarks/>
|
|
ATA,
|
|
|
|
/// <remarks/>
|
|
ATD,
|
|
|
|
/// <remarks/>
|
|
SEC,
|
|
|
|
/// <remarks/>
|
|
POBA,
|
|
|
|
/// <remarks/>
|
|
POBD,
|
|
|
|
/// <remarks/>
|
|
NAME,
|
|
|
|
/// <remarks/>
|
|
TIEFA,
|
|
|
|
/// <remarks/>
|
|
TIEFD,
|
|
|
|
/// <remarks/>
|
|
BKRA,
|
|
|
|
/// <remarks/>
|
|
BKRD,
|
|
|
|
/// <remarks/>
|
|
STAT,
|
|
|
|
/// <remarks/>
|
|
LADG,
|
|
|
|
/// <remarks/>
|
|
INFO,
|
|
|
|
/// <remarks/>
|
|
SERV,
|
|
|
|
/// <remarks/>
|
|
PRE72H,
|
|
|
|
/// <remarks/>
|
|
MDH,
|
|
|
|
/// <remarks/>
|
|
WAS,
|
|
|
|
/// <remarks/>
|
|
CREW,
|
|
|
|
/// <remarks/>
|
|
PAS,
|
|
|
|
/// <remarks/>
|
|
BPOL,
|
|
|
|
/// <remarks/>
|
|
TOWA,
|
|
|
|
/// <remarks/>
|
|
TOWD,
|
|
|
|
/// <remarks/>
|
|
HAZA,
|
|
|
|
/// <remarks/>
|
|
HAZD,
|
|
}
|
|
|
|
public partial class RootMessage
|
|
{
|
|
|
|
private string idField;
|
|
|
|
private RootMessageType typeField;
|
|
|
|
private string locationField;
|
|
|
|
private string textField;
|
|
|
|
private static System.Xml.Serialization.XmlSerializer serializer;
|
|
|
|
public string ID
|
|
{
|
|
get
|
|
{
|
|
return this.idField;
|
|
}
|
|
set
|
|
{
|
|
this.idField = value;
|
|
}
|
|
}
|
|
|
|
public RootMessageType Type
|
|
{
|
|
get
|
|
{
|
|
return this.typeField;
|
|
}
|
|
set
|
|
{
|
|
this.typeField = value;
|
|
}
|
|
}
|
|
|
|
public string Location
|
|
{
|
|
get
|
|
{
|
|
return this.locationField;
|
|
}
|
|
set
|
|
{
|
|
this.locationField = value;
|
|
}
|
|
}
|
|
|
|
public string Text
|
|
{
|
|
get
|
|
{
|
|
return this.textField;
|
|
}
|
|
set
|
|
{
|
|
this.textField = value;
|
|
}
|
|
}
|
|
|
|
private static System.Xml.Serialization.XmlSerializer Serializer
|
|
{
|
|
get
|
|
{
|
|
if ((serializer == null))
|
|
{
|
|
serializer = new System.Xml.Serialization.XmlSerializer(typeof(RootMessage));
|
|
}
|
|
return serializer;
|
|
}
|
|
}
|
|
|
|
#region Serialize/Deserialize
|
|
/// <summary>
|
|
/// Serializes current RootMessage object into an XML document
|
|
/// </summary>
|
|
/// <returns>string XML value</returns>
|
|
public virtual string Serialize()
|
|
{
|
|
System.IO.StreamReader streamReader = null;
|
|
System.IO.MemoryStream memoryStream = null;
|
|
try
|
|
{
|
|
memoryStream = new System.IO.MemoryStream();
|
|
Serializer.Serialize(memoryStream, this);
|
|
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
|
|
streamReader = new System.IO.StreamReader(memoryStream);
|
|
return streamReader.ReadToEnd();
|
|
}
|
|
finally
|
|
{
|
|
if ((streamReader != null))
|
|
{
|
|
streamReader.Dispose();
|
|
}
|
|
if ((memoryStream != null))
|
|
{
|
|
memoryStream.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Deserializes workflow markup into an RootMessage object
|
|
/// </summary>
|
|
/// <param name="xml">string workflow markup to deserialize</param>
|
|
/// <param name="obj">Output RootMessage object</param>
|
|
/// <param name="exception">output Exception value if deserialize failed</param>
|
|
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
|
|
public static bool Deserialize(string xml, out RootMessage obj, out System.Exception exception)
|
|
{
|
|
exception = null;
|
|
obj = default(RootMessage);
|
|
try
|
|
{
|
|
obj = Deserialize(xml);
|
|
return true;
|
|
}
|
|
catch (System.Exception ex)
|
|
{
|
|
exception = ex;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static bool Deserialize(string xml, out RootMessage obj)
|
|
{
|
|
System.Exception exception = null;
|
|
return Deserialize(xml, out obj, out exception);
|
|
}
|
|
|
|
public static RootMessage Deserialize(string xml)
|
|
{
|
|
System.IO.StringReader stringReader = null;
|
|
try
|
|
{
|
|
stringReader = new System.IO.StringReader(xml);
|
|
return ((RootMessage)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
|
|
}
|
|
finally
|
|
{
|
|
if ((stringReader != null))
|
|
{
|
|
stringReader.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Serializes current RootMessage 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 virtual bool SaveToFile(string fileName, out System.Exception exception)
|
|
{
|
|
exception = null;
|
|
try
|
|
{
|
|
SaveToFile(fileName);
|
|
return true;
|
|
}
|
|
catch (System.Exception e)
|
|
{
|
|
exception = e;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public virtual void SaveToFile(string fileName)
|
|
{
|
|
System.IO.StreamWriter streamWriter = null;
|
|
try
|
|
{
|
|
string xmlString = Serialize();
|
|
System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
|
|
streamWriter = xmlFile.CreateText();
|
|
streamWriter.WriteLine(xmlString);
|
|
streamWriter.Close();
|
|
}
|
|
finally
|
|
{
|
|
if ((streamWriter != null))
|
|
{
|
|
streamWriter.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Deserializes xml markup from file into an RootMessage object
|
|
/// </summary>
|
|
/// <param name="fileName">string xml file to load and deserialize</param>
|
|
/// <param name="obj">Output RootMessage object</param>
|
|
/// <param name="exception">output Exception value if deserialize failed</param>
|
|
/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
|
|
public static bool LoadFromFile(string fileName, out RootMessage obj, out System.Exception exception)
|
|
{
|
|
exception = null;
|
|
obj = default(RootMessage);
|
|
try
|
|
{
|
|
obj = LoadFromFile(fileName);
|
|
return true;
|
|
}
|
|
catch (System.Exception ex)
|
|
{
|
|
exception = ex;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static bool LoadFromFile(string fileName, out RootMessage obj)
|
|
{
|
|
System.Exception exception = null;
|
|
return LoadFromFile(fileName, out obj, out exception);
|
|
}
|
|
|
|
public static RootMessage LoadFromFile(string fileName)
|
|
{
|
|
System.IO.FileStream file = null;
|
|
System.IO.StreamReader sr = null;
|
|
try
|
|
{
|
|
file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
|
|
sr = new System.IO.StreamReader(file);
|
|
string xmlString = sr.ReadToEnd();
|
|
sr.Close();
|
|
file.Close();
|
|
return Deserialize(xmlString);
|
|
}
|
|
finally
|
|
{
|
|
if ((file != null))
|
|
{
|
|
file.Dispose();
|
|
}
|
|
if ((sr != null))
|
|
{
|
|
sr.Dispose();
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
|
|
public enum RootMessageType
|
|
{
|
|
|
|
/// <remarks/>
|
|
INFO,
|
|
|
|
/// <remarks/>
|
|
WARNING,
|
|
|
|
/// <remarks/>
|
|
VIOLATION,
|
|
|
|
/// <remarks/>
|
|
ERROR,
|
|
}
|
|
}
|