ESRI.ArcGIS.Mobile
ReadOnlyLayerCollection Class
Members  Example  See Also  Send Feedback
ESRI.ArcGIS.Mobile Namespace : ReadOnlyLayerCollection Class

Collection of Cache Layers.

Object Model

Syntax

Visual Basic (Declaration) 
<DefaultMemberAttribute("Item")>
Public NotInheritable Class ReadOnlyLayerCollection 
C# 
[DefaultMemberAttribute("Item")]
public sealed class ReadOnlyLayerCollection 

Example

Assuming you have a MobileService called mobileService1 and it's open, the following examples shows you how to get a Layer by index or layer name.
C#Copy Code
LayerCollection clc = mobileService1.Layers; 
// Method 1: Gets the first layer in the collection 
MessageBox.Show(cl[0].Name); 
  
// Method 2: Gets the layer named "Watervalve" 
MessageBox.Show(cl["Watervalve"].Name); 
    

Remarks

LayerCollection contains all locally cached layers stored in MobileService, and provides information to inspect each layer in terms of default visibility, editable or not, editing type, editing version name, etc. For more information, see Layer.

You can check the number of layers contained in the LayerCollection by using Count property. To check if a specific cache layer exists in the collection, use Contains method. To get the index for a specific cache layer in the collection, use IndexOf method.

To get a Layer from LayerCollection by index or name, see examples below.

Inheritance Hierarchy

System.Object
   ESRI.ArcGIS.Mobile.ReadOnlyLayerCollection

Requirements

Namespace: ESRI.ArcGIS.Mobile

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

Assembly: ESRI.ArcGIS.Mobile (in ESRI.ArcGIS.Mobile.dll)

See Also