Esempio n. 1
0
 private void Validate(IGraphNode controlNode, IGraphNode validatedNode)
 {
     if (controlNode.Equals(validatedNode))
     {
         throw new Exception("Forbidden: Creating such a connection would result in a cycle");
     }
     else
     {
         foreach (IGraphEdge edge in validatedNode.GetRegisteredConnections())
         {
             if (edge.GetStartNode().Equals(validatedNode))
             {
                 Validate(controlNode, edge.GetEndNode());
             }
         }
     }
 }
Esempio n. 2
0
 public void RemoveNode(IGraphNode node)
 {
     if (node.Equals(Activity.Start) || node.Equals(Activity.End))
     {
         return;
     }
     foreach (IGraphEdge edge in node.GetRegisteredConnections())
     {
         RemoveEdge(edge);
     }
     while (nodes.Remove(node))
     {
         ;
     }
     node.Destroy();
     Analyze();
 }