Core/CafeLib.Core.Collections.DirectedGraph/Graph.cs
/// <summary>
/// Inserts a vertex into an edge.
/// </summary>
/// <param name="vertex">vertex to be inserted</param>
/// <param name="edge">edge the vertex is inserted into</param>
Inserts a vertex into an edge.
Inserts a vertex into an edge .
public void Insert(IVertex vertex, IEdge edge)
	    {
            var v = (Vertex<T>)vertex;
            var source = (Vertex<T>)edge.From;
            var target = (Vertex<T>)edge.To;
            _vertices.Add(v);
            source.Detach(target);
            source.Attach(v);
            v.Attach(target);
        }
public void Insert ( IVertex vertex , IEdge edge ) { var v = ( Vertex < T > ) vertex ; var source = ( Vertex < T > ) edge . From ; var target = ( Vertex < T > ) edge . To ; _vertices . Add ( v ) ; source . Detach ( target ) ; source . Attach ( v ) ; v . Attach ( target ) ; }
Inserts a vertex into an edge.
Inserts a vertex into an edge .
vertex
IVertex
vertex to be inserted
vertex to be inserted
edge
IEdge
edge the vertex is inserted into
edge the vertex is inserted into