ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / SelectionSet Class / Equals Method / Equals(SelectionSet) Method
The SelectionSet used in the comparison.
Example

In This Topic
    Equals(SelectionSet) Method
    In This Topic
    Determines whether the specified SelectionSet is equivalent to the current SelectionSet.
    Syntax
    Public Overloads Function Equals( _
       ByVal other As SelectionSet _
    ) As Boolean
    public bool Equals( 
       SelectionSet other
    )

    Parameters

    other
    The SelectionSet used in the comparison.

    Return Value

    True if the SelectionSet is equivalent.
    Example
    Check SelectionSet Equality
    {
        // get map selection
        var mapSelSet = MapView.Active.Map.GetSelection();
    
        // create a selectionSet
        var selDict = new Dictionary<MapMember, List<long>>();
        selDict.Add(featureLayer, new List<long> { 1506, 2696, 2246, 1647, 948 });
        var layerSelSet = ArcGIS.Desktop.Mapping.SelectionSet.FromDictionary(selDict);
    
        // test for equality - use Equals method
        var isEquals = mapSelSet.Equals(layerSelSet);
    
        // test for equality - use operators
        var equals = mapSelSet == layerSelSet;
        var notEquals = mapSelSet != layerSelSet;
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.6 or higher.
    See Also