ESRI.ArcGIS.ADF.IMS
StaticLayerDataset Class
Members  Example  See Also 
ESRI.ArcGIS.ADF.IMS.Data Namespace : StaticLayerDataset Class




A Dataset object for static layers.

Syntax

Visual Basic (Declaration) 
<SerializableAttribute()>
Public Class StaticLayerDataset 
   Inherits Dataset
Visual Basic (Usage)Copy Code
Dim instance As StaticLayerDataset
C# 
[SerializableAttribute()]
public class StaticLayerDataset : Dataset 

Example

The following example prints out a list of static (pre-existing) layers in the map service. It assumes an existing MapView object, along with a label web control on the page.
C#Copy Code
System.Text.StringBuilder sb = new System.Text.StringBuilder(); 

  

LayerCollection lyrColl = mapView.Layers; 

FeatureLayer fLayer; 

ImageLayer iLayer; 

  

foreach (Layer layer in lyrColl) 



    fLayer = layer as FeatureLayer; 

    if (fLayer != null) 

    { 

        if (fLayer.Dataset is ESRI.ArcGIS.ADF.IMS.Data.StaticLayerDataset) 

            sb.AppendFormat("{0}<br/>", fLayer.Name); 

    } 

    else 

    { 

        iLayer = layer as ImageLayer; 

        if (iLayer != null) 

        { 

            if (iLayer.Dataset is ESRI.ArcGIS.ADF.IMS.Data.StaticLayerDataset) 

                sb.AppendFormat("{0}<br/>", iLayer.Name); 

        } 

    } 



  

Label1.Text = sb.ToString(); 

    
Visual BasicCopy Code
Dim sb As New System.Text.StringBuilder()



Dim lyrColl As LayerCollection = mapView.Layers

Dim fLayer As FeatureLayer

Dim iLayer As ImageLayer



For Each layer As Layer In lyrColl



    If Typeof layer Is FeatureLayer Then



        fLayer = CType(layer, FeatureLayer)



        If Typeof fLayer.Dataset Is ESRI.ArcGIS.ADF.IMS.Data.StaticLayerDataset Then

            sb.AppendFormat("{0}<br/>", fLayer.Name)

        End If



    ElseIf Typeof layer Is ImageLayer Then



        iLayer = CType(layer, ImageLayer)



        If Typeof iLayer.Dataset Is ESRI.ArcGIS.ADF.IMS.Data.StaticLayerDataset Then

            sb.AppendFormat("{0}<br/>", iLayer.Name)

        End If



    End If

Next



Label1.Text = sb.ToString()

Remarks

Layers that are included in the map service will have a StaticLayerDataset as their Dataset object. A StaticLayerDataset has no properties, and no information about the underlying data source for the layer is available from the ArcIMS server, other than the Fields (ESRI.ArcGIS.ADF.IMS.Data.Dataset), which may contain information on the attribute fields of the layer.

Only feature layers (FeatureLayer) and image layers (ImageLayer) in the map service will have a Dataset property. Acetate layers (AcetateLayer) have no Dataset property, even if they exist in the map service as static layers.

Inheritance Hierarchy

System.Object
   ESRI.ArcGIS.ADF.IMS.Data.Dataset
      ESRI.ArcGIS.ADF.IMS.Data.StaticLayerDataset

See Also

© 2010 All Rights Reserved.