/// <summary> /// Deserializes workflow markup into an WorkflowActivities object /// </summary> // <param name="xml">string workflow markup to deserialize</param> // <param name="obj">Output WorkflowActivities 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 WorkflowActivities 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(WorkflowActivities)); obj = ((WorkflowActivities)(xmlSerializer.Deserialize(xmlTextReader))); return true; } catch (System.Exception e) { exception = e; return false; } }
/// <summary> /// Deserializes workflow markup from file into an WorkflowActivities object /// </summary> // <param name="xml">string workflow markup to deserialize</param> // <param name="obj">Output WorkflowActivities 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 WorkflowActivities 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 e) { exception = e; return false; } }
public Workflow() { if ((this.mediumField == null)) { this.mediumField = new List<Medium>(); } if ((this.isAttachedField == null)) { this.isAttachedField = new List<IsAttached>(); } if ((this.personField == null)) { this.personField = new List<Person>(); } if ((this.deviceField == null)) { this.deviceField = new List<Device>(); } if ((this.formField == null)) { this.formField = new List<Form>(); } if ((this.connectionField == null)) { this.connectionField = new List<Connection>(); } if ((this.decisionField == null)) { this.decisionField = new List<Decision>(); } if ((this.callField == null)) { this.callField = new List<Call>(); } if ((this.boundaryField == null)) { this.boundaryField = new List<Boundary>(); } if ((this.activitiesField == null)) { this.activitiesField = new WorkflowActivities(); } }