/// <summary> /// Outputs the data for this query object as an XMLSection. /// </summary> /// <returns>An XML representation of this object.</returns> public XMLSection ToXML() { XMLSection section = new XMLSection("query"); section.AddChild("name", Name); section.AddChild("database", Database); section.AddChild("dataview", DataView); section.AddChild("interval", Interval.ToString()); section.AddChild("time", Time.ToString()); if (Delimiter != ",") { section.AddChild("delimiter", Delimiter); } if (Transpose) { section.AddChild("transpose", Transpose); } if (PrintHeaders) { section.AddChild("printHeaders", PrintHeaders); } if (Paused) { section.AddChild("paused", Paused); } section.AddSection(Output.ToXML()); return(section); }
/// <summary> /// Converts the contents of this list into an XMLFile. /// </summary> /// <returns>An XMLFile object containing all the queries in this list.</returns> public XMLFile ToXML() { XMLFile file = new XMLFile(FilePath); file.Children.Clear(); XMLSection top = new XMLSection("queries"); foreach (Query q in this) { top.AddSection(q.ToXML()); } file.AddSection(top); return(file); }