Exemplo n.º 1
0
 /// <summary>
 /// Deserializes workflow markup into an AttributeLists object
 /// </summary>
 // <param name="xml">string workflow markup to deserialize</param>
 // <param name="obj">Output AttributeLists 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 AttributeLists obj, out System.Exception exception)
 {
     exception = null;
     obj       = null;
     try
     {
         System.IO.StringReader   stringReader  = new System.IO.StringReader(xml);
         System.Xml.XmlTextReader xmlTextReader = new System.Xml.XmlTextReader(stringReader);
         System.Xml.Serialization.XmlSerializer xmlSerializer = new System.Xml.Serialization.XmlSerializer(typeof(AttributeLists));
         obj = ((AttributeLists)(xmlSerializer.Deserialize(xmlTextReader)));
         return(true);
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return(false);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Deserializes workflow markup from file into an AttributeLists object
 /// </summary>
 // <param name="xml">string workflow markup to deserialize</param>
 // <param name="obj">Output AttributeLists 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 AttributeLists obj, out System.Exception exception)
 {
     exception = null;
     obj       = null;
     try
     {
         System.IO.FileStream   file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
         System.IO.StreamReader sr   = new System.IO.StreamReader(file);
         string xmlString            = sr.ReadToEnd();
         sr.Close();
         file.Close();
         return(Deserialize(xmlString, out obj, out exception));
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return(false);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Deserializes workflow markup from file into an AttributeLists object
 /// </summary>
 // <param name="xml">string workflow markup to deserialize</param>
 // <param name="obj">Output AttributeLists 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 AttributeLists obj, out System.Exception exception)
 {
     exception = null;
     obj = null;
     try
     {
         System.IO.FileStream file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
         System.IO.StreamReader sr = new System.IO.StreamReader(file);
         string xmlString = sr.ReadToEnd();
         sr.Close();
         file.Close();
         return Deserialize(xmlString, out obj, out exception);
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return false;
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Deserializes workflow markup into an AttributeLists object
 /// </summary>
 // <param name="xml">string workflow markup to deserialize</param>
 // <param name="obj">Output AttributeLists 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 AttributeLists obj, out System.Exception exception)
 {
     exception = null;
     obj = null;
     try
     {
         System.IO.StringReader stringReader = new System.IO.StringReader(xml);
         System.Xml.XmlTextReader xmlTextReader = new System.Xml.XmlTextReader(stringReader);
         System.Xml.Serialization.XmlSerializer xmlSerializer = new System.Xml.Serialization.XmlSerializer(typeof(AttributeLists));
         obj = ((AttributeLists)(xmlSerializer.Deserialize(xmlTextReader)));
         return true;
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return false;
     }
 }