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

SetAllEdgesSelected() protected method

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

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

            foreach ( IEdge oSelectedEdge in m_oSelectedEdges.ToArray() )
            {
                SetEdgeSelectedInternal(oSelectedEdge, false);
            }
        }
    }
NodeXLControl