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

CheckForVertexDragOnMouseUp() protected method

protected CheckForVertexDragOnMouseUp ( System.Windows.Input.MouseEventArgs oMouseEventArgs ) : void
oMouseEventArgs System.Windows.Input.MouseEventArgs
return void
    CheckForVertexDragOnMouseUp
    (
        MouseEventArgs oMouseEventArgs
    )
    {
        Debug.Assert(oMouseEventArgs != null);
        AssertValid();

        if ( m_oVerticesBeingDragged != null &&
            m_oVerticesBeingDragged.OnMouseUp() )
        {
            Boolean bEscapeKeyIsPressed = this.EscapeKeyIsPressed();

            // Remove from the top of the graph any dragged vertices drawn
            // during the previous MouseMove event.

            RemoveVisualFromTopOfGraph(m_oVerticesBeingDragged);

            if (bEscapeKeyIsPressed)
            {
                m_oVerticesBeingDragged.CancelDrag();
            }

            // Remove metadata that VerticesBeingDragged added to the dragged
            // vertices.

            m_oVerticesBeingDragged.RemoveMetadataFromVertices();

            if (!bEscapeKeyIsPressed)
            {
                // If edge bundling is being used, rebundle the edges that are
                // attached to the dragged vertices.

                RebundleIncidentEdgesIfAppropriate(
                    m_oVerticesBeingDragged.Vertices);
            }

            // m_oVerticesBeingDragged may have moved the selected vertices, so
            // redraw the graph.

            DrawGraph();

            if (!bEscapeKeyIsPressed)
            {
                IVertex [] aoDraggedVertices =
                    m_oVerticesBeingDragged.Vertices;

                UpdateCollapsedGroupLocations(aoDraggedVertices);
                FireVerticesMoved(aoDraggedVertices);
            }
        }

        m_oVerticesBeingDragged = null;
    }
NodeXLControl