/// <summary> /// /// </summary> /// <param name="fileName"></param> /// <param name="constraint"></param> public static void SaveToFile(string fileName, string constraint) { XElement root = new XElement("Graph"); SVGraphResult graph = new SVGraphResult(); graph.extractGraph(); var graphNodes = graph.Nodes; foreach (var node in graphNodes) { XElement alert = new XElement("Node", new XAttribute("Type", node.Type), new XAttribute("AlertID", node.AlertID)); foreach (var pNode in node.PostNodes) { XElement pAlert = new XElement("ConsequentNode", new XAttribute("Type", pNode.Type), new XAttribute("AlertID", pNode.AlertID)); alert.Add(pAlert); } root.Add(node); } root.Save(fileName); }
/// <summary> /// /// </summary> /// <param name="fileName"></param> /// <param name="constraint"></param> public static void SaveToFile(string fileName, string constraint) { XElement root = new XElement("Graph"); SVGraphResult graph = new SVGraphResult(); graph.extractGraph(); var graphNodes = graph.Nodes; foreach (var node in graphNodes) { XElement alert = new XElement("Node", new XAttribute("Type", node.Type), new XAttribute("AlertID",node.AlertID)); foreach (var pNode in node.PostNodes) { XElement pAlert = new XElement("ConsequentNode", new XAttribute("Type", pNode.Type), new XAttribute("AlertID", pNode.AlertID)); alert.Add(pAlert); } root.Add(node); } root.Save(fileName); }