Gets the items contained within the PackageLayer.

Namespace:  ESRI.ArcGISExplorer.Mapping

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

Syntax

C#
public MapItemCollection ChildItems { get; }
Visual Basic (Declaration)
Public ReadOnly Property ChildItems As MapItemCollection

Field Value

A MapItemCollection containing PackageChildLayer objects.

Implements

IMapItemParent..::.ChildItems

Remarks

This property is only useful if a PackageLayer has been created from an ArcGIS Desktop group layer. The MapItemCollection will contain PackageChildLayer objects representing each of the layers within the group layer. If the PackageLayer contains a single ArcGIS Desktop layer the returned MapItemCollection will always be empty.

For more information, see the remarks section of the ChildItems property.

Examples

The code below uses the ChildItems property to access and print the names of the PackageChildLayer objects in the selected PackageLayer. Each one represents a layer contained within an ArcGIS Desktop group layer.
CopyC#
//Return the selected items in the contents view.  
SelectedItemsCollection selectItems = ESRI.ArcGISExplorer.Application.Application.SelectedItems;

//check that a single PackageLayer MapItem is selected
if ((selectItems.Count == 1) && (selectItems[0] is PackageLayer))
{
  PackageLayer pl = selectItems[0] as PackageLayer;

  //Check to see whether the PackageLayer has child objects. 
  //These will represent the layers contained in an ArcGIS Desktop group layer.
  if (pl.ChildItems.Count > 0)
  {
    //Loop over the collection, printing out the name of each PackageChildLayer
    foreach (PackageChildLayer childLayer in pl.ChildItems)
    {
      System.Diagnostics.Debug.Print(childLayer.Name);
    }
  }
}
CopyVB.NET
'Return the selected items in the contents view.  
Dim selectItems As SelectedItemsCollection = ESRI.ArcGISExplorer.Application.Application.SelectedItems

'check that a single PackageLayer MapItem is selected
If (selectItems.Count = 1) AndAlso (TypeOf selectItems.Item(0) Is PackageLayer) Then

  Dim pl As PackageLayer = DirectCast(selectItems.Item(0), PackageLayer)

  'Check to see whether the PackageLayer has child objects. 
  'These will represent the layers contained in an ArcGIS Desktop group layer.
  If (pl.ChildItems.Count > 0) Then
    'Loop over the collection, printing out the name of each PackageChildLayer
    For Each childLayer As PackageChildLayer In pl.ChildItems
      System.Diagnostics.Debug.Print(childLayer.Name)
    Next
  End If

End If

See Also