Selects the specified set of MapItems in the Contents window, and unselects all other MapItems.

Namespace:  ESRI.ArcGISExplorer.Application

Assembly:  ESRI.ArcGISExplorer.Application (in ESRI.ArcGISExplorer.Application.dll) Version: 2.0.0.1500 (2.0.0.1500)

Syntax

C#
public void Select<T>(
	IEnumerable<T> mapItems
)
where T : MapItem
Visual Basic (Declaration)
Public Sub Select(Of T As MapItem) ( _
	mapItems As IEnumerable(Of T) _
)

Parameters

mapItems
Type: System.Collections.Generic..::.IEnumerable<(Of <(T>)>)

The enumerable set of MapItems to select.

Type Parameters

T
The Type contained in the collection, must be MapItem or a derived Type.

Remarks

This overload of the Select method allows you to select multiple items in the Contents window, by passing in any object which supports the generic IEnumerable interface which contains MapItems or derived Types.

When the selection is changed, the MapItemSelectionChanged is triggered.

Examples

The code below demonstrates one way to use the overloaded Select method of SelectedItemsCollection to select all of the MapItems of a certain Type. First, a collection of all the Notes in the current map is created using Map.GetMapItems. Next, this collection is applied using the Select method.
CopyC#
// Find all of the Note MapItems currently in the map.
ESRI.ArcGISExplorer.Mapping.MapDisplay disp = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay;
System.Collections.ObjectModel.ReadOnlyCollection<Note> allNotes = disp.Map.GetMapItems<Note>();

// Get the selected items object.
ESRI.ArcGISExplorer.Application.SelectedItemsCollection selItems = ESRI.ArcGISExplorer.Application.Application.SelectedItems;

// Change the selection - here select all of the Notes found previously.
selItems.Select(allNotes);  // This will trigger Application.MapItemSelectionChanged.
CopyVB.NET
' Find all of the Note MapItems currently in the map.
Dim disp As ESRI.ArcGISExplorer.Mapping.MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay
Dim allNotes As System.Collections.ObjectModel.ReadOnlyCollection(Of Note) = disp.Map.GetMapItems(Of Note)()

' Get the selected items object.
Dim selItems As ESRI.ArcGISExplorer.Application.SelectedItemsCollection = ESRI.ArcGISExplorer.Application.Application.SelectedItems

' Change the selection - here select all of the Notes found previously.
selItems.Select(allNotes) ' This will trigger Application.MapItemSelectionChanged.

See Also