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


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

IContentsView.AddToSelectedItems Method

Adds to the selected items.

[Visual Basic .NET]
Public Sub AddToSelectedItems ( _
    ByVal item As Object _
)
[C#]
public void AddToSelectedItems (
    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 add a  single legend class to the selection.

For example: If Array(0)=pMap, Array(1)=pLayer, Array(2)=pLegendGroup, and Array(3)=n, then the method will add 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 add multiple legend classes to the selection.

See Also

IContentsView Interface