Smrf.NodeXL.ExcelTemplate.TaskPane.ForceLayoutTheseVerticesOnly C# (CSharp) Method

ForceLayoutTheseVerticesOnly() protected method

protected ForceLayoutTheseVerticesOnly ( ICollection oVerticesToLayOut, String sLayoutTypeIsNullWarning ) : void
oVerticesToLayOut ICollection
sLayoutTypeIsNullWarning String
return void
    ForceLayoutTheseVerticesOnly
    (
        ICollection<IVertex> oVerticesToLayOut,
        String sLayoutTypeIsNullWarning
    )
    {
        Debug.Assert(oVerticesToLayOut != null);
        Debug.Assert( !String.IsNullOrEmpty(sLayoutTypeIsNullWarning) );
        AssertValid();

        if (oNodeXLControl.IsLayingOutGraph)
        {
            return;
        }

        if (LayoutIsNull)
        {
            ShowLayoutTypeIsNullWarning(sLayoutTypeIsNullWarning);
            return;
        }

        // This method works by adding a value to the graph specifying that
        // only the specified vertices should be laid out and all other
        // vertices should be completely ignored.
        //
        // When the graph layout completes (which happens asynchronously),
        // oNodeXLControl_GraphLaidOut() removes the value.

        oNodeXLControl.Graph.SetValue(
            ReservedMetadataKeys.LayOutTheseVerticesOnly, oVerticesToLayOut);

        ForceLayout();
    }
TaskPane