protected DataColumn GetDataColumn(IGraphNode item, Boolean DoRegister = true) { graphData head = this; if (head.parent != null) { head = gRoot; // gRoot.Schema; } String key = head.GetUID(item, DoRegister); DataColumn dc = null; if (!head.dataTable.Columns.Contains(key)) { if (!DoRegister) { return(null); } dc = head.dataTable.Columns.Add(key); } else { dc = head.dataTable.Columns[key]; } return(dc); }
public static graphData Build(IGraphNode source, Boolean KeepReferenceToSourceNodes) { graphData node = null; var items = source.getAllChildren(); foreach (IGraphNode entry in items) { node = graphTools.ConvertPathToGraph <graphData>(node, entry.path, true, source.pathSeparator, true); // node.StoredDataObject = DataObjectGetter(entry); if (KeepReferenceToSourceNodes) { node.SourceNode = entry; } node = node.root as graphData; } if (node == null) { node = new graphData(); } node.Deploy(items.Count); return(node); }
public List <DataColumn> SelectAllMatches(IGraphNode node) { graphData head = this; if (head.parent != null) { head = gRoot; } List <DataColumn> output = new List <DataColumn>(); var dc = head.GetDataColumn(node, false); if (dc != null) { output.Add(dc); } var all = node.getAllChildren(); foreach (IGraphNode c in all) { dc = head.GetDataColumn(c, false); if (dc != null) { output.Add(dc); } } return(output); }
public DataColumn this[IGraphNode node] { get { graphData head = this; if (head.parent != null) { head = gRoot; // gRoot.Schema; } return(head.GetDataColumn(node)); } }
public String GetNodeCategory(graphData Instance) { if (_NodeCategory == default(String)) { if (Instance != null) { if (_NodeCategoryFunction != null) { return(_NodeCategoryFunction(Instance)); } } } return(_NodeCategory); }
public String GetNodeLabel(graphData Instance) { if (_NodeLabel == default(String)) { if (Instance != null) { if (_NodeLabelFunction != null) { return(_NodeLabelFunction(Instance)); } } } return(_NodeLabel); }
public String GetNodeColor(graphData Instance) { if (_NodeColor == default(String)) { if (Instance != null) { if (_NodeColorFunction != null) { return(_NodeColorFunction(Instance)); } } } return(_NodeColor); }
public void FlushSourceReferences() { graphData head = this; if (head.parent != null) { head = gRoot; } var items = head.getAllChildren(); foreach (graphData entry in items) { entry.SourceNode = null; } }
public Double GetLinkWeight(graphData child) { if (this.ContainsKey(child.name)) { if (LinkWeights.ContainsKey(child.name)) { return(LinkWeights[child.name]); } else { return(1); } } else { return(0); } }
protected void Deploy(Int32 inputcount) { graphData head = this; if (head.parent != null) { head = gRoot; } head.dataTable = new DataTable(); head.NodeByColumnName.Clear(); var items = this.getAllChildren(); foreach (graphData entry in items) { head.GetDataColumn(entry); } head.ConstructionInfo = new StructureGraphInformation(); head.ConstructionInfo.Populate(head); head.ConstructionInfo.InputCount = inputcount; }
internal String GetUID(IGraphNode item, Boolean DoRegister = true) { graphData head = this; if (head.parent != null) { head = gRoot; } if (item == null) { return("null"); } String key = md5.GetMd5Hash(item.level.ToString("D3") + item.path); if (DoRegister) { if (!head.NodeByColumnName.ContainsKey(key)) { head.NodeByColumnName.Add(key, item); } } return(key); }