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

SetEdgeSelected() public method

public SetEdgeSelected ( IEdge edge, System.Boolean selected, System.Boolean alsoAdjacentVertices ) : void
edge IEdge
selected System.Boolean
alsoAdjacentVertices System.Boolean
return void
    SetEdgeSelected
    (
        IEdge edge,
        Boolean selected,
        Boolean alsoAdjacentVertices
    )
    {
        AssertValid();

        const String MethodName = "SetEdgeSelected";

        this.ArgumentChecker.CheckArgumentNotNull(MethodName, "edge", edge);
        CheckIfLayingOutGraph(MethodName);

        // Update the selected state of the edge and its adjacent vertices.

        SetEdgeSelectedInternal(edge, selected);

        if (alsoAdjacentVertices)
        {
            SetVertexSelectedInternal(edge.Vertices[0], selected);
            SetVertexSelectedInternal(edge.Vertices[1], selected);
        }

        FireSelectionChanged();
    }

Usage Example

Ejemplo n.º 1
0
        btnSetEdgeSelected_Click
        (
            object sender,
            EventArgs e
        )
        {
            try
            {
                Int32 iEdgeID = Int32.Parse(txbEdgeID.Text);

                IEdge oEdge;

                if (!m_oNodeXLControl.Graph.Edges.Find(iEdgeID, out oEdge))
                {
                    throw new ArgumentException("No such ID.");
                }

                m_oNodeXLControl.SetEdgeSelected(oEdge,
                                                 chkEdgeSelected.Checked, chkAlsoAdjacentVertices.Checked);
            }
            catch (Exception oException)
            {
                MessageBox.Show(oException.Message);
            }
        }
NodeXLControl