Esempio n. 1
0
 public static void BaseOnAdd(Node node, GraphNet graph)
 {
     node.GetDependentNodes(graph).Clear();
     node.Edges.ForEach(e =>
     {
         if (e.Obj != node && !graph.ContainsNode(e.Obj))
         {
             node.GetDependentNodes(graph).Add(e.Obj);
         }
         if (e.Subject != node && !graph.ContainsNode(e.Subject))
         {
             node.GetDependentNodes(graph).Add(e.Subject);
         }
         graph.Add(e);
     });
 }
Esempio n. 2
0
        public static void BaseOnRemove(Node node, GraphNet graph)
        {
            foreach (var e in node.Edges)
            {
                graph.Remove(e);
            }

            node.GetDependentNodes(graph).ForEach(n =>
            {
                if (graph.ContainsNode(n))
                {
                    graph.Remove(n);
                }
            });
        }