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

SetEdgeSelectedInternal() protected method

protected SetEdgeSelectedInternal ( IEdge oEdge, System.Boolean bSelected ) : void
oEdge IEdge
bSelected System.Boolean
return void
    SetEdgeSelectedInternal
    (
        IEdge oEdge,
        Boolean bSelected
    )
    {
        Debug.Assert(oEdge != null);
        AssertValid();

        if ( !VertexOrEdgeCanBeSelected(oEdge, bSelected) )
        {
            return;
        }

        // Modify the edge's metadata to mark it as selected or unselected.

        MarkVertexOrEdgeAsSelected(oEdge, bSelected);

        // Modify the collection of selected edges.

        if (bSelected)
        {
            m_oSelectedEdges.Add(oEdge);
        }
        else
        {
            m_oSelectedEdges.Remove(oEdge);
        }

        // Redraw the edge using its modified metadata.

        Debug.Assert(m_oLastGraphDrawingContext != null);

        m_oGraphDrawer.RedrawEdge(oEdge, m_oLastGraphDrawingContext);
    }
NodeXLControl