Stores information about the vertex that was most recently double-clicked in the NodeXLControl.
Inheritance: Object
Ejemplo n.º 1
0
    OnVertexDoubleClickLeft
    (
        IVertex oDoubleClickedVertex
    )
    {
        Debug.Assert(oDoubleClickedVertex != null);
        AssertValid();

        // Double-clicking a vertex the first time should select the vertex's
        // level-1 subgraph, double-clicking it again should select its level-2
        // subgraph, and so on.

        if (m_oDoubleClickedVertexInfo == null ||
            m_oDoubleClickedVertexInfo.Vertex != oDoubleClickedVertex)
        {
            // Note that the DoubleClickedVertexInfo constructor sets the
            // Levels property to 0.

            m_oDoubleClickedVertexInfo = new DoubleClickedVertexInfo(
                oDoubleClickedVertex);
        }

        m_oDoubleClickedVertexInfo.Levels++;

        Dictionary<IVertex, Int32> oSubgraphVertices;
        HashSet<IEdge> oSubgraphEdges;

        SubgraphCalculator.GetSubgraph(oDoubleClickedVertex,
            m_oDoubleClickedVertexInfo.Levels,
            m_bMouseAlsoSelectsIncidentEdges, out oSubgraphVertices,
            out oSubgraphEdges);

        foreach (IVertex oSubgraphVertex in oSubgraphVertices.Keys)
        {
            SetVertexSelectedInternal(oSubgraphVertex, true);
        }

        foreach (IEdge oSubgraphEdge in oSubgraphEdges)
        {
            SetEdgeSelectedInternal(oSubgraphEdge, true);
        }

        FireSelectionChanged();
    }