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

VertexOrEdgeCanBeSelected() protected method

protected VertexOrEdgeCanBeSelected ( IMetadataProvider oVertexOrEdge, System.Boolean bSelected ) : System.Boolean
oVertexOrEdge IMetadataProvider
bSelected System.Boolean
return System.Boolean
    VertexOrEdgeCanBeSelected
    (
        IMetadataProvider oVertexOrEdge,
        Boolean bSelected
    )
    {
        Debug.Assert(oVertexOrEdge != null);
        AssertValid();

        if (!bSelected)
        {
            // A vertex or edge can always be deselected.

            return (true);
        }

        switch ( VertexAndEdgeDrawerBase.GetVisibility(oVertexOrEdge) )
        {
            case VisibilityKeyValue.Visible:

                return (true);

            case VisibilityKeyValue.Hidden:

                return (false);

            case VisibilityKeyValue.Filtered:

                // A filtered vertex or edge can be selected as long as it is
                // not completely transparent.

                return (this.EdgeDrawer.FilteredAlpha > 0);

            default:

                Debug.Assert(false);
                return (true);
        }
    }
NodeXLControl