public Graph AddGraph(string name) { var gr = new Graph() { Name = name }; SubGraphs.Add(gr); return(gr); }
/// <summary> /// Перемещает узлы по подграфам /// </summary> public void MoveNodesToSubgraphs() { foreach (var n in Nodes.ToArray()) { if (!string.IsNullOrWhiteSpace(n.SubgraphCode)) { var sg = ResolveSubgraph(n.SubgraphCode); if (null == sg) { sg = new SubGraph { Code = n.SubgraphCode, Parent = this }; SubGraphs.Add(sg); } sg.Nodes.Add(n); n.Parent = sg; Nodes.Remove(n); } } }