This document is archived and information here might be outdated.  Recommended version.


IContentsView.RemoveFromSelectedItems Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (ArcMapUI)  

IContentsView.RemoveFromSelectedItems Method

Removes an item from the selected items.

[Visual Basic .NET]
Public Sub RemoveFromSelectedItems ( _
    ByVal item As Object _
)
[C#]
public void RemoveFromSelectedItems (
    object item
);

Product Availability

Available with ArcGIS Desktop.

Description

This method is not functional for TOCSelectionView. When working with a TOCDisplayView or TOCCatalogView the item parameter has several usages:

1. The parameter can be a single object of any of the following types:

IMap
ILayer
ILegendGroup
IWorkspace (source view only)
IDataset (source view only)
IStandaloneTable (source view only)

2. The parameter can be a Set of items of the types listed in 1. Only multiple items of the same type can be selected simultaneously, so the Set should contain items of the same type.

3. The parameter can be an array where the contents of the array represent the hierarchical path to a single selected item. Use this to remove a  single legend class from the selection.

For example: If Array(0)=pMap, Array(1)=pLayer, Array(2)=pLegendGroup, and Array(3)=n, then the method will remove the nth legend class in pLegendGroup. When building the array, include higher-level objects (in this case the IMap and ILayer objects) to improve peformance.

4. The parameter can be an array which contains an array of the structure explained in 3. Use this to remove multiple legend classes from the selection.

See Also

IContentsView Interface