Smrf.NodeXL.Visualization.Wpf.NodeXLControl.SetAllVerticesSelected C# (CSharp) Method

SetAllVerticesSelected() protected method

protected SetAllVerticesSelected ( System.Boolean bSelected ) : void
bSelected System.Boolean
return void
    SetAllVerticesSelected
    (
        Boolean bSelected
    )
    {
        AssertValid();

        if (bSelected)
        {
            foreach (IVertex oVertex in this.Graph.Vertices)
            {
                SetVertexSelectedInternal(oVertex, true);
            }
        }
        else
        {
            // Do not directly iterate m_oSelectedVertices here.  Keys may be
            // removed by SetVertexSelectedInternal() and you can't modify a
            // collection while it's being iterated.  Copy the collection to
            // an array first.

            foreach ( IVertex oSelectedVertex in
                m_oSelectedVertices.ToArray() )
            {
                SetVertexSelectedInternal(oSelectedVertex, false);
            }
        }
    }
NodeXLControl