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); }
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; }
private void removeEdge(tEdge aEdge) { aEdge.fromNode.outEdges.Remove(aEdge); aEdge.toNode.inEdges.Remove(aEdge); Edges.Remove(aEdge); }