public XmlNode GenerateXML() { // Create XML Node and Attributes XmlDocument d = new XmlDocument(); XmlNode output = d.CreateNode("element", "Action", null); XmlAttribute type = d.CreateAttribute("Type"); XmlAttribute variable = d.CreateAttribute("Variable"); XmlAttribute dontEval = d.CreateAttribute("DontEval"); XmlAttribute condition = d.CreateAttribute("Condition"); // Assign attribute values type.Value = "TSVar"; variable.Value = Variable; dontEval.Value = DontEval.ToString(); condition.Value = Condition; // Append Attributes output.Attributes.Append(type); output.Attributes.Append(variable); if (null != DontEval) { output.Attributes.Append(dontEval); } if (!string.IsNullOrEmpty(Condition)) { output.Attributes.Append(condition); } output.InnerText = Content; return(output); }
public XmlNode GenerateXML() { // Create XML Node and Attributes XmlDocument d = new XmlDocument(); XmlNode output = d.CreateNode("element", "Case", null); XmlAttribute caseInsensitive = d.CreateAttribute("CaseInsensitive"); XmlAttribute dontEval = d.CreateAttribute("DontEval"); XmlAttribute regEx = d.CreateAttribute("RegEx"); XmlAttribute condition = d.CreateAttribute("Condition"); // Set Attribute Values caseInsensitive.Value = CaseInsensitive.ToString(); dontEval.Value = DontEval.ToString(); regEx.Value = RegEx; condition.Value = Condition; // Append Attributes output.Attributes.Append(caseInsensitive); output.Attributes.Append(dontEval); output.Attributes.Append(regEx); if (!string.IsNullOrEmpty(Condition)) { output.Attributes.Append(condition); } // Append Children foreach (Variable v in SubChildren) { XmlNode importNode = d.ImportNode(v.GenerateXML(), true); output.AppendChild(importNode); } return(output); }
public XmlNode GenerateXML() { // Create XML Node and Attributes XmlDocument d = new XmlDocument(); XmlNode output = d.CreateNode("element", "Action", null); XmlAttribute type = d.CreateAttribute("Type"); XmlAttribute onValue = d.CreateAttribute("OnValue"); XmlAttribute dontEval = d.CreateAttribute("DontEval"); XmlAttribute condition = d.CreateAttribute("Condition"); // Assign attribute values type.Value = ActionType; onValue.Value = OnValue; dontEval.Value = DontEval.ToString(); condition.Value = Condition; // Append Attributes output.Attributes.Append(type); output.Attributes.Append(onValue); if (null != DontEval) { output.Attributes.Append(dontEval); } if (!string.IsNullOrEmpty(Condition)) { output.Attributes.Append(condition); } // Append Children foreach (Case c in SubChildren) { XmlNode importNode = d.ImportNode(c.GenerateXML(), true); output.AppendChild(importNode); } return(output); }
public XmlNode GenerateXML() { // Create XML Node and Attributes XmlDocument d = new XmlDocument(); XmlNode output = d.CreateNode("element", "Variable", null); XmlAttribute name = d.CreateAttribute("Name"); XmlAttribute dontEval = d.CreateAttribute("DontEval"); XmlAttribute condition = d.CreateAttribute("Condition"); // Set Attribute Value name.Value = Name; dontEval.Value = DontEval.ToString(); condition.Value = Condition; // Append Attributes output.Attributes.Append(name); output.Attributes.Append(dontEval); output.Attributes.Append(condition); // Append Content output.InnerText = Content; return(output); }