public static NodeGraph Build(List <LeafNodeDictionaryEntry> items) { StructureGraphInformation info = new StructureGraphInformation(); List <String> xpathList = new List <string>(); NodeGraph node = null; foreach (LeafNodeDictionaryEntry entry in items) { if (!xpathList.Contains(entry.XPath)) { node = graphTools.ConvertPathToGraph <NodeGraph>(node, entry.XPath, true, "/", true); node.SetItem(entry); node = node.root as NodeGraph; xpathList.Add(entry.XPath); } } if (node == null) { node = new NodeGraph(); } info.Populate(node); info.InputCount = items.Count; node.ConstructionInfo = info; //var CompleteGraph = graphTools.BuildGraphFromItems<LeafNodeDictionaryEntry, NodeGraph>(items, getPath, "/"); return(node); }
/// <summary> /// Gets information on current state of the graph /// </summary> /// <returns></returns> public StructureGraphInformation GetCurrentInfo() { StructureGraphInformation info = new StructureGraphInformation(); info.Populate(this); return(info); }