Adds the specified MapItem to the start 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(
	MapItem item
)
Visual Basic (Declaration)
Public Sub AddFirst ( _
	item As MapItem _
)

Parameters

item
Type: ESRI.ArcGISExplorer.Mapping..::.MapItem

A MapItem object which represents a type of map content.

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 a FeatureLayer to the Map. The AddFirst method ensures that the MapItem will appear at the top of the Contents View.
CopyC#
{
  //Get the MapDisplay
  MapDisplay mapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay;

  //Create a FeatureLayer for a file geodatabase feature class
  FeatureLayer fLayer = FeatureLayer.OpenFileGeodatabaseTable(@"C:\Data\Yellowstone\yellowstone.gdb", "campsites");

  //Add the FeatureLayer to the start of the MapItemCollection which adds the layer to the Map.
  //It will appear at the top of the contents view.
  mapDisplay.Map.ChildItems.AddFirst(fLayer);
}
CopyVB.NET
'Get the MapDisplay
Dim mapDisp As MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay

'Create a FeatureLayer for a file geodatabase feature class
Dim fLayer As FeatureLayer = FeatureLayer.OpenFileGeodatabaseTable("C:\Data\Yellowstone\yellowstone.gdb", "campsites")

'Add the FeatureLayer to the start of the MapItemCollection which adds the layer to the Map.
'It will appear at the top of the contents view.
mapDisp.Map.ChildItems.AddFirst(fLayer)

See Also