Esempio n. 1
0
        public Graph AddGraph(string name)
        {
            var gr = new Graph()
            {
                Name = name
            };

            SubGraphs.Add(gr);

            return(gr);
        }
Esempio n. 2
0
 /// <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);
         }
     }
 }