Пример #1
0
 public bool ContainsEdge(tEdge aEdge)
 {
     foreach (tEdge lEdge in Edges)
     {
         if (lEdge.fromNode.Name == aEdge.fromNode.Name && lEdge.toNode.Name == aEdge.toNode.Name)
         {
             return(true);
         }
     }
     return(false);
 }
Пример #2
0
        private tEdge addEdge(tNode fromNode, tNode toNode)
        {
            if (fromNode == null || toNode == null)
            {
                throw new ArgumentNullException();
            }
            //tEdge exists = FindEdge(fromNode.Name, toNode.Name);
            //if (null == exists)
            //{
            tEdge e = new tEdge(fromNode, toNode);

            Edges.Add(e);
            fromNode.outEdges.Add(e);
            toNode.inEdges.Add(e);
            return(e);
            //}
            //return exists;
        }
Пример #3
0
 private void removeEdge(tEdge aEdge)
 {
     aEdge.fromNode.outEdges.Remove(aEdge);
     aEdge.toNode.inEdges.Remove(aEdge);
     Edges.Remove(aEdge);
 }