Adds the specified enumerable set of MapItem objects to the top of the collection.

Namespace:  ESRI.ArcGISExplorer.Mapping

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

Syntax

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

Parameters

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

An enumerable set containing MapItem objects each of which represents a type of map content.

Type Parameters

T
A type of MapItem.

Remarks

When the AddFirst method is used on MapItemCollection associated with the Map, the added MapItem will appear at the top of the Contents window.

Examples

The code below demonstrates how to add multiple MapItems to the Map using a single method call. The AddFirst method ensures that the added MapItems will appear at the top of the Contents View.
CopyC#
{
  //Get the MapDisplay
  MapDisplay mapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay;

  //Create some Notes
  CoordinateSystem coordSys = CoordinateSystem.GeographicCoordinateSystems.World.WGS1984;
  Note note1 = new Note("Note 1", new ESRI.ArcGISExplorer.Geometry.Point(0,1,coordSys));
  Note note2 = new Note("Note 2", new ESRI.ArcGISExplorer.Geometry.Point(10,5,coordSys));
  Note note3 = new Note("Note 3", new ESRI.ArcGISExplorer.Geometry.Point(0, 55,coordSys));

  //Add Notes to a new MapItemCollection
  MapItemCollection mapItems = new MapItemCollection();
  mapItems.Add(note1);
  mapItems.Add(note2);
  mapItems.Add(note3);

  //Add all the Notes to the Map 
  mapDisplay.Map.ChildItems.AddFirst(mapItems);
}
CopyVB.NET
'Get the MapDisplay
Dim mapDisp As MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay

'Create some Notes
Dim coordSys As CoordinateSystem = CoordinateSystem.GeographicCoordinateSystems.World.WGS1984
Dim note1 As Note = New Note("Note 1", New ESRI.ArcGISExplorer.Geometry.Point(0, 1, coordSys))
Dim note2 As Note = New Note("Note 2", New ESRI.ArcGISExplorer.Geometry.Point(10, 5, coordSys))
Dim note3 As Note = New Note("Note 3", New ESRI.ArcGISExplorer.Geometry.Point(0, 55, coordSys))

'Add Notes to a new MapItemCollection
Dim mapItems As MapItemCollection = New MapItemCollection()
mapItems.Add(note1)
mapItems.Add(note2)
mapItems.Add(note3)

'Add all the Notes to the Map 
mapDisp.Map.ChildItems.AddFirst(mapItems)

See Also