Represents a collection of edges.
This is a collection of objects that implement the IEdge interface. You can add edges to the collection, remove them, access an edge, and enumerate all edges.
상속: NodeXLBase, IEdgeCollection
예제 #1
0
    Graph
    (
        GraphDirectedness directedness
    )
    :
    base( m_oIDGenerator.GetNextID() )
    {
        const String MethodName = "Constructor";

        this.ArgumentChecker.CheckArgumentIsDefined(
            MethodName, "directedness", directedness,
            typeof(GraphDirectedness) );

        m_eDirectedness = directedness;

        m_oVertexCollection = new VertexCollection(this);
        m_oEdgeCollection = new EdgeCollection(this);

        AssertValid();
    }
예제 #2
0
    GetEdgeCollection
    (
        out EdgeCollection oEdgeCollection
    )
    {
        AssertValid();

        const String MethodName = "GetEdgeCollection";

        oEdgeCollection = null;

        if (m_oParentGraph == null)
        {
            // The vertex does not belong to a graph.

            return (false);
        }

        if ( !(m_oParentGraph.Edges is EdgeCollection) )
        {
            Debug.Assert(false);

            throw new ApplicationException( String.Format(

                "{0}.{1}: The Edges property of the graph that owns this"
                + " vertex is not of type EdgeCollection."
                ,
                this.ClassName,
                MethodName
                ) );
        }

        oEdgeCollection = (EdgeCollection)(m_oParentGraph.Edges);

        return (true);
    }