Пример #1
0
 /// <summary>
 /// creates a detached edge
 /// </summary>
 /// <param name="sourceNode"></param>
 /// <param name="targetNode"></param>
 /// <param name="connection">controls is the edge will be connected to the graph</param>
 public Edge(Node sourceNode, Node targetNode, ConnectionToGraph connection)
     : this(sourceNode.Id, null, targetNode.Id)
 {
     this.SourceNode = sourceNode;
     this.TargetNode = targetNode;
     if (connection == ConnectionToGraph.Connected)
     {
         if (sourceNode == targetNode)
         {
             sourceNode.AddSelfEdge(this);
         }
         else
         {
             sourceNode.AddOutEdge(this);
             targetNode.AddInEdge(this);
         }
     }
 }