Smrf.NodeXL.Visualization.Wpf.GraphDrawer.GetVerticesFromRectangle C# (CSharp) Method

GetVerticesFromRectangle() public method

public GetVerticesFromRectangle ( Rect rectangle ) : ICollection
rectangle System.Windows.Rect
return ICollection
    GetVerticesFromRectangle
    (
        Rect rectangle
    )
    {
        AssertValid();

        LinkedList<IVertex> oVertices = new LinkedList<IVertex>();

        if (m_oAllVertexDrawingVisuals != null)
        {
            // Hit-test using an anonymous delegate to avoid having to create
            // a named callback method.

            m_oAllVertexDrawingVisuals.HitTest(null,
            
                delegate (HitTestResult hitTestResult)
                {
                    DependencyObject oVisualHit = hitTestResult.VisualHit;

                    if ( typeof(DrawingVisual).IsInstanceOfType(oVisualHit) )
                    {
                        // Retrieve the vertex.

                        oVertices.AddLast( RetrieveVertexFromDrawingVisual(
                            (DrawingVisual)oVisualHit) );
                    }

                    return (HitTestResultBehavior.Continue);
                }, 

                new GeometryHitTestParameters(
                    new RectangleGeometry(rectangle) )
                );
        }

        return (oVertices);
    }