Visual Basic (Declaration) | |
---|---|
Public Sub GetAllDetails( _ ByVal onCompleted As Action(Of IDictionary(Of Integer,FeatureLayerInfo),Exception) _ ) |
C# | |
---|---|
public void GetAllDetails( Action<IDictionary<int,FeatureLayerInfo>,Exception> onCompleted ) |
The GetAllDetails Method returns a Dictionary of FeatureLayerInfo objects. The FeatureLayerInfo object is rich with numerous Properties that can be used to get metadata information about the sub-layers in an ArcGISTiledMapServiceLayer web service. To get the details for a specific sub-layer in an ArcGISTiledMapServiceLayer consider using the ArcGISTiledMapServiceLayer.GetDetails instead.
Parameters
- onCompleted
- The method to call when details of the sub-layer or table is retrieved.
How to use:
When the application loads an ArcGISTiledMapServiceLayer will be added to the Map Control. Numerous pieces of Property information about the Layer will be displayed in the TextBox that is obtained from the ArcGISTiledMapServiceLayer.GetAllDetails Method.
The XAML code in this example is used in conjunction with the code-behind (C# or VB.NET) to demonstrate the functionality.
The following screen shot corresponds to the code example in this page.
XAML | Copy Code |
---|---|
<Grid x:Name="LayoutRoot"> <!-- Add a Map Control and zoom into the Florida region. --> <esri:Map Background="White" HorizontalAlignment="Left" Margin="7,91,0,0" Name="Map1" VerticalAlignment="Top" Height="503" Width="390" Extent="-9678745,2721421,-8685613,4002307"> <!-- Add an ArcGISTiledMapServiceLayer. Note that the Initialized Event handler is wired up for code-behind. --> <esri:ArcGISTiledMapServiceLayer ID="Soil_Survey_Map" Url="http://server.arcgisonline.com/ArcGIS/rest/services/Specialty/Soil_Survey_Map/MapServer" Initialized="ArcGISTiledMapServiceLayer_Initialized"/> </esri:Map> <!-- Add a TextBox to hold the results of the ArcGISTiledMapServiceLayer.GetAllDetails Method. --> <TextBox Height="497" HorizontalAlignment="Left" Margin="403,91,0,0" Name="TextBox1" VerticalAlignment="Top" Width="300" TextWrapping="Wrap" VerticalScrollBarVisibility="Visible"/> <!-- Provide the instructions on how to use the sample code. --> <TextBlock Height="86" HorizontalAlignment="Left" Name="TextBlock1" VerticalAlignment="Top" Width="703" TextWrapping="Wrap" Text="When the application loads an ArcGISTiledMapServiceLayer will be added to the Map Control. Numerous pieces of Property information about the Layer will be displayed in the TextBox that is obtained from the ArcGISTiledMapServiceLayer.GetAllDetails Method." /> </Grid> |
C# | Copy Code |
---|---|
private void ArcGISTiledMapServiceLayer_Initialized(object sender, System.EventArgs e) { // Get the ArcGISTiledMapServiceLayer from the Map Control by its ID value that was set in XAML. ESRI.ArcGIS.Client.ArcGISTiledMapServiceLayer myArcGISTiledMapServiceLayer = null; myArcGISTiledMapServiceLayer = (ESRI.ArcGIS.Client.ArcGISTiledMapServiceLayer)(Map1.Layers["Soil_Survey_Map"]); // Invoke the ArcGISTiledMapServiceLayer.GetAllDetails Method to display numerous Property information back to // the user in the TextBox. Rather than put all of the code nested within this function which would cause the // formatting to have a lot of white-space from the indenting of using a lambda expression, put the coding logic // into another function (DoGetAllDetails). myArcGISTiledMapServiceLayer.GetAllDetails(DoGetAllDetails); } private void DoGetAllDetails(IDictionary<int, ESRI.ArcGIS.Client.FeatureService.FeatureLayerInfo> myDictionaryOfFeatureLayerInfo, Exception myException) { // This function does the work of displaying the details of the ArcGISTiledMapServiceLayer in the Textbox. // Make sure we do not have an error. if (myException == null) { // Create a StringBuilder object to hold the Property information. System.Text.StringBuilder myStringBuilder = new System.Text.StringBuilder(); // Loop through the Dictionary for each FeatureLayerInfo object. foreach (var myFeatureLayerInfo in myDictionaryOfFeatureLayerInfo) { // Get the sub-layer ID. int? myID = myFeatureLayerInfo.Value.Id; if (myID != null) { myStringBuilder.Append("Sub-layer ID: " + myID.ToString() + Environment.NewLine); } else { myStringBuilder.Append("Sub-layer ID: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer AllowGeometryUpdates. bool? myAllowGeometryUpdates = myFeatureLayerInfo.Value.AllowGeometryUpdates; if (myAllowGeometryUpdates != null) { myStringBuilder.Append("AllowGeometryUpdates: " + myAllowGeometryUpdates.ToString() + Environment.NewLine); } else { myStringBuilder.Append("AllowGeometryUpdates: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer CanModifyLayer. bool? myCanModifyLayer = myFeatureLayerInfo.Value.CanModifyLayer; if (myCanModifyLayer != null) { myStringBuilder.Append("CanModifyLayer: " + myCanModifyLayer.ToString() + Environment.NewLine); } else { myStringBuilder.Append("CanModifyLayer: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer CanScaleSymbols. bool? myCanScaleSymbols = myFeatureLayerInfo.Value.CanScaleSymbols; if (myCanScaleSymbols != null) { myStringBuilder.Append("CanScaleSymbols: " + myCanScaleSymbols.ToString() + Environment.NewLine); } else { myStringBuilder.Append("CanScaleSymbols: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer Capabilities. IEnumerable<string> myCapabilities = myFeatureLayerInfo.Value.Capabilities; if (myCapabilities != null) { myStringBuilder.Append("Capabilities: " + Environment.NewLine); foreach (string myCabability in myCapabilities) { myStringBuilder.Append("--" + myCabability + Environment.NewLine); } } else { myStringBuilder.Append("Capabilities: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer CopyrightText. string myCopyrightText = myFeatureLayerInfo.Value.CopyrightText; if (myCopyrightText != null) { myStringBuilder.Append("CopyrightText: " + myCopyrightText + Environment.NewLine); } else { myStringBuilder.Append("CopyrightText: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer DefaultSpatialReference. ESRI.ArcGIS.Client.Geometry.SpatialReference myDefaultSpatialReference = myFeatureLayerInfo.Value.DefaultSpatialReference; if (myDefaultSpatialReference != null) { int? myWKID = myDefaultSpatialReference.WKID; string myWKT = myDefaultSpatialReference.WKT; if (myWKID != null) { myStringBuilder.Append("DefaultSpatialReference (WKID): " + myWKID.ToString() + Environment.NewLine); } else { myStringBuilder.Append("DefaultSpatialReference (WKT): " + myWKT + Environment.NewLine); } } else { myStringBuilder.Append("DefaultSpatialReference: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer LayerDefintion. string myDefinitionExpression = myFeatureLayerInfo.Value.DefinitionExpression; if (myDefinitionExpression != null) { myStringBuilder.Append("DefinitionExpression: " + myDefinitionExpression + Environment.NewLine); } else { myStringBuilder.Append("DefinitionExpression: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer Description. string myDescription = myFeatureLayerInfo.Value.Description; if (myDescription != null) { myStringBuilder.Append("Description: " + myDescription + Environment.NewLine); } else { myStringBuilder.Append("Description: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer DisplayField. string myDisplayField = myFeatureLayerInfo.Value.DisplayField; if (myDisplayField != null) { myStringBuilder.Append("DisplayField: " + myDisplayField + Environment.NewLine); } else { myStringBuilder.Append("DisplayField: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer EditFieldsInfo. ESRI.ArcGIS.Client.FeatureService.EditFieldsInfo myEditFieldsInfo = myFeatureLayerInfo.Value.EditFieldsInfo; if (myEditFieldsInfo != null) { string myCreationDateField = myEditFieldsInfo.CreationDateField; string myCreatorField = myEditFieldsInfo.CreatorField; string myEditDateField = myEditFieldsInfo.EditDateField; string myEditorField = myEditFieldsInfo.EditorField; string myRealm = myEditFieldsInfo.Realm; myStringBuilder.Append("EditFieldsInfo: " + Environment.NewLine); myStringBuilder.Append("--CreationDateField: " + myCreationDateField + Environment.NewLine); myStringBuilder.Append("--CreatorField: " + myCreatorField + Environment.NewLine); myStringBuilder.Append("--EditDateField: " + myEditDateField + Environment.NewLine); myStringBuilder.Append("--EditorField: " + myEditorField + Environment.NewLine); myStringBuilder.Append("--Realm: " + myRealm + Environment.NewLine); } else { myStringBuilder.Append("EditFieldsInfo: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer EnableZDefaults. bool? myEnableZDefaults = myFeatureLayerInfo.Value.EnableZDefaults; if (myEnableZDefaults != null) { myStringBuilder.Append("EnableZDefaults: " + myEnableZDefaults.ToString() + Environment.NewLine); } else { myStringBuilder.Append("EnableZDefaults: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer Extent. ESRI.ArcGIS.Client.Geometry.Envelope myExtent = myFeatureLayerInfo.Value.Extent; if (myExtent != null) { myStringBuilder.Append("Extent: " + myExtent.ToString() + Environment.NewLine); } else { myStringBuilder.Append("Extent: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer FeatureTypes. IDictionary<object, ESRI.ArcGIS.Client.FeatureService.FeatureType> myFeatureTypes = myFeatureLayerInfo.Value.FeatureTypes; if (myFeatureTypes != null) { myStringBuilder.Append("FeatureTypes (Count): " + myFeatureTypes.Count.ToString() + Environment.NewLine); foreach (object x in myFeatureTypes) { ESRI.ArcGIS.Client.FeatureService.FeatureType myFeatureType = (ESRI.ArcGIS.Client.FeatureService.FeatureType)myFeatureTypes[x]; IDictionary<string, ESRI.ArcGIS.Client.FeatureService.Domain> myFT_Domains = myFeatureType.Domains; object myFT_Id = myFeatureType.Id; string myFT_Name = myFeatureType.Name; IDictionary<string, ESRI.ArcGIS.Client.FeatureService.FeatureTemplate> myFT_Templates = myFeatureType.Templates; myStringBuilder.Append("--" + myFT_Name + Environment.NewLine); } } else { myStringBuilder.Append("FeatureTypes: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer Fields. List<ESRI.ArcGIS.Client.Field> myFields = myFeatureLayerInfo.Value.Fields; if (myFields != null) { myStringBuilder.Append("Fields (Count): " + myFields.Count.ToString() + Environment.NewLine); foreach (ESRI.ArcGIS.Client.Field myField in myFields) { string myF_Alias = myField.Alias; ESRI.ArcGIS.Client.FeatureService.Domain myF_Domain = myField.Domain; bool myF_Editable = myField.Editable; int myF_Length = myField.Length; string myF_Name = myField.Name; bool myF_Nullable = myField.Nullable; ESRI.ArcGIS.Client.Field.FieldType myF_Type = myField.Type; myStringBuilder.Append("--" + myF_Name + Environment.NewLine); } } else { myStringBuilder.Append("Fields: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer GeometryType. ESRI.ArcGIS.Client.Tasks.GeometryType? myGeometryType = myFeatureLayerInfo.Value.GeometryType; if (myGeometryType != null) { myStringBuilder.Append("GeometryType: " + myGeometryType.ToString() + Environment.NewLine); } else { myStringBuilder.Append("GeometryType: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer GlobalIdField. string myGlobalIdField = myFeatureLayerInfo.Value.GlobalIdField; if (myGlobalIdField != null) { myStringBuilder.Append("GlobalIdField: " + myGlobalIdField + Environment.NewLine); } else { myStringBuilder.Append("GlobalIdField: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer HasAttachments. bool? myHasAttachments = myFeatureLayerInfo.Value.HasAttachments; if (myHasAttachments != null) { myStringBuilder.Append("HasAttachments: " + myHasAttachments.ToString() + Environment.NewLine); } else { myStringBuilder.Append("HasAttachments: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer HasLabels. bool? myHasLabels = myFeatureLayerInfo.Value.HasLabels; if (myHasLabels != null) { myStringBuilder.Append("HasLabels: " + myHasLabels.ToString() + Environment.NewLine); } else { myStringBuilder.Append("HasLabels: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer HasM. bool? myHasM = myFeatureLayerInfo.Value.HasM; if (myHasM != null) { myStringBuilder.Append("HasM: " + myHasM.ToString() + Environment.NewLine); } else { myStringBuilder.Append("HasM: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer HasZ. bool? myHasZ = myFeatureLayerInfo.Value.HasZ; if (myHasZ != null) { myStringBuilder.Append("HasZ: " + myHasZ.ToString() + Environment.NewLine); } else { myStringBuilder.Append("HasZ: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer IsAddAllowed. bool? myIsAddAllowed = myFeatureLayerInfo.Value.IsAddAllowed; if (myIsAddAllowed != null) { myStringBuilder.Append("IsAddAllowed: " + myIsAddAllowed.ToString() + Environment.NewLine); } else { myStringBuilder.Append("IsAddAllowed: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer IsDataVersioned. bool? myIsDataVersioned = myFeatureLayerInfo.Value.IsDataVersioned; if (myIsDataVersioned != null) { myStringBuilder.Append("IsDataVersioned: " + myIsDataVersioned.ToString() + Environment.NewLine); } else { myStringBuilder.Append("IsDataVersioned: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer IsDeleteAllowed. bool? myIsDeleteAllowed = myFeatureLayerInfo.Value.IsDeleteAllowed; if (myIsDeleteAllowed != null) { myStringBuilder.Append("IsDeleteAllowed: " + myIsDeleteAllowed.ToString() + Environment.NewLine); } else { myStringBuilder.Append("IsDeleteAllowed: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer IsReadOnly. bool? myIsReadOnly = myFeatureLayerInfo.Value.IsReadOnly; if (myIsReadOnly != null) { myStringBuilder.Append("IsReadOnly: " + myIsReadOnly.ToString() + Environment.NewLine); } else { myStringBuilder.Append("IsReadOnly: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer IsUpdateAllowed. bool? myIsUpdateAllowed = myFeatureLayerInfo.Value.IsUpdateAllowed; if (myIsUpdateAllowed != null) { myStringBuilder.Append("IsUpdateAllowed: " + myIsUpdateAllowed.ToString() + Environment.NewLine); } else { myStringBuilder.Append("IsUpdateAllowed: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer MaximumScale. double? myMaximumScale = myFeatureLayerInfo.Value.MaximumScale; if (myMaximumScale != null) { myStringBuilder.Append("MaximumScale: " + myMaximumScale.ToString() + Environment.NewLine); } else { myStringBuilder.Append("MaximumScale: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer MaxRecordCount. int? myMaxRecordCount = myFeatureLayerInfo.Value.MaxRecordCount; if (myMaxRecordCount != null) { myStringBuilder.Append("MaxRecordCount: " + myMaxRecordCount.ToString() + Environment.NewLine); } else { myStringBuilder.Append("MaxRecordCount: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer MinimumScale. double? myMinimumScale = myFeatureLayerInfo.Value.MinimumScale; if (myMinimumScale != null) { myStringBuilder.Append("MinimumScale: " + myMinimumScale.ToString() + Environment.NewLine); } else { myStringBuilder.Append("MinimumScale: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer Name. string myName = myFeatureLayerInfo.Value.Name; if (myName != null) { myStringBuilder.Append("Name: " + myName + Environment.NewLine); } else { myStringBuilder.Append("Name: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer ObjectIdField. string myObjectIdField = myFeatureLayerInfo.Value.ObjectIdField; if (myObjectIdField != null) { myStringBuilder.Append("ObjectIdField: " + myObjectIdField + Environment.NewLine); } else { myStringBuilder.Append("ObjectIdField: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer OwnershipBasedAccessControl. ESRI.ArcGIS.Client.FeatureService.OwnershipBasedAccessControl myOwnershipBasedAccessControl = myFeatureLayerInfo.Value.OwnershipBasedAccessControl; if (myOwnershipBasedAccessControl != null) { bool myOBAC_AllowOthersToDelete = myOwnershipBasedAccessControl.AllowOthersToDelete; bool myOBAC_AllowOthersToUpdate = myOwnershipBasedAccessControl.AllowOthersToUpdate; myStringBuilder.Append("OwnershipBasedAccessControl (AllowOtherToDelete): " + myOBAC_AllowOthersToDelete.ToString() + Environment.NewLine); myStringBuilder.Append("OwnershipBasedAccessControl (AllowOtherToUpdate): " + myOBAC_AllowOthersToUpdate.ToString() + Environment.NewLine); } else { myStringBuilder.Append("OwnershipBasedAccessControl: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer Relationships. IEnumerable<ESRI.ArcGIS.Client.FeatureService.Relationship> myRelationships = myFeatureLayerInfo.Value.Relationships; if (myRelationships != null) { myStringBuilder.Append("Relationships (Count): " + myRelationships.Count().ToString() + Environment.NewLine); foreach (ESRI.ArcGIS.Client.FeatureService.Relationship myRelationship in myRelationships) { ESRI.ArcGIS.Client.FeatureService.Cardinality myR_Cardinality = myRelationship.Cardinality; int myR_Id = myRelationship.Id; bool myR_IsComposite = myRelationship.IsComposite; string myR_KeyField = myRelationship.KeyField; string myR_KeyFieldInRelationshipTable = myRelationship.KeyFieldInRelationshipTable; string myR_Name = myRelationship.Name; int myR_RelatedTableId = myRelationship.RelatedTableId; int myR_RelationshipTableId = myRelationship.RelationshipTableId; ESRI.ArcGIS.Client.FeatureService.Role myR_Role = myRelationship.Role; myStringBuilder.Append("--" + myR_Name + Environment.NewLine); } } else { myStringBuilder.Append("Relationships: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer Renderer. ESRI.ArcGIS.Client.IRenderer myRenderer = myFeatureLayerInfo.Value.Renderer; if (myRenderer != null) { myStringBuilder.Append("Renderer: " + myRenderer.ToString() + Environment.NewLine); } else { myStringBuilder.Append("Renderer: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer SupportsAdvancedQueries. bool? mySupportsAdvancedQueries = myFeatureLayerInfo.Value.SupportsAdvancedQueries; if (mySupportsAdvancedQueries != null) { myStringBuilder.Append("SupportsAdvancedQueries: " + mySupportsAdvancedQueries.ToString() + Environment.NewLine); } else { myStringBuilder.Append("SupportsAdvancedQueries: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer SupportsStatistics. bool? mySupportsStatistics = myFeatureLayerInfo.Value.SupportsStatistics; if (mySupportsStatistics != null) { myStringBuilder.Append("SupportsStatistics: " + mySupportsStatistics.ToString() + Environment.NewLine); } else { myStringBuilder.Append("SupportsStatistics: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer Templates. IDictionary<object, ESRI.ArcGIS.Client.FeatureService.FeatureTemplate> myTemplates = (IDictionary<object, ESRI.ArcGIS.Client.FeatureService.FeatureTemplate>)myFeatureLayerInfo.Value.Templates; if (myTemplates != null) { myStringBuilder.Append("Templates (Count): " + myTemplates.Count.ToString() + Environment.NewLine); foreach (object x in myTemplates) { ESRI.ArcGIS.Client.FeatureService.FeatureTemplate myTemplate = (ESRI.ArcGIS.Client.FeatureService.FeatureTemplate)myTemplates[x]; string myT_Description = myTemplate.Description; ESRI.ArcGIS.Client.FeatureService.FeatureEditTool myT_DrawingTool = myTemplate.DrawingTool; string myT_Name = myTemplate.Name; IDictionary<string, object> myT_PrototypeAttributes = myTemplate.PrototypeAttributes; ESRI.ArcGIS.Client.Geometry.Geometry myT_PrototypeGeometry = myTemplate.PrototypeGeometry; myStringBuilder.Append("--" + myT_Name + Environment.NewLine); } } else { myStringBuilder.Append("Templates: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer Type. string myType = myFeatureLayerInfo.Value.Type; if (myType != null) { myStringBuilder.Append("Type: " + myType + Environment.NewLine); } else { myStringBuilder.Append("Type: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer TypeIdField. string myTypeIdField = myFeatureLayerInfo.Value.TypeIdField; if (myTypeIdField != null) { myStringBuilder.Append("TypeIdField: " + myTypeIdField + Environment.NewLine); } else { myStringBuilder.Append("TypeIdField: [Nothing/null]" + Environment.NewLine); } // Get the sub-layer ZDefault. double? myZDefault = myFeatureLayerInfo.Value.ZDefault; if (myZDefault != null) { myStringBuilder.Append("ZDefault: " + myZDefault.ToString() + Environment.NewLine); } else { myStringBuilder.Append("ZDefault: [Nothing/null]" + Environment.NewLine); } myStringBuilder.Append("-------------------------" + Environment.NewLine); } // Put all of the Property information about the ArcGISTiledMapServiceLayer in the TextBox. TextBox1.Text = myStringBuilder.ToString(); } } |
VB.NET | Copy Code |
---|---|
Private Sub ArcGISTiledMapServiceLayer_Initialized(ByVal sender As System.Object, ByVal e As System.EventArgs) ' Get the ArcGISTiledMapServiceLayer from the Map Control by its ID value that was set in XAML. Dim myArcGISTiledMapServiceLayer As ESRI.ArcGIS.Client.ArcGISTiledMapServiceLayer myArcGISTiledMapServiceLayer = CType(Map1.Layers("Soil_Survey_Map"), ESRI.ArcGIS.Client.ArcGISTiledMapServiceLayer) ' Invoke the ArcGISTiledMapServiceLayer.GetAllDetails Method to display numerous Property information back to ' the user in the TextBox. Rather than put all of the code nested within this function which would cause the ' formatting to have a lot of white-space from the indenting of using a lambda expression, put the coding logic ' into another function (DoGetAllDetails). myArcGISTiledMapServiceLayer.GetAllDetails(AddressOf DoGetAllDetails) End Sub Private Sub DoGetAllDetails(myDictionaryOfFeatureLayerInfo As IDictionary(Of Integer, ESRI.ArcGIS.Client.FeatureService.FeatureLayerInfo), myException As Exception) ' This function does the work of displaying the details of the ArcGISTiledMapServiceLayer in the Textbox. /// ' Make sure we do not have an error. If myException Is Nothing Then ' Create a StringBuilder object to hold the Property information. Dim myStringBuilder As New Text.StringBuilder ' Loop through the Dictionary for each FeatureLayerInfo object. For Each myFeatureLayerInfo In myDictionaryOfFeatureLayerInfo ' Get the sub-layer ID. Dim myID As Nullable(Of Integer) = myFeatureLayerInfo.Value.Id If myID IsNot Nothing Then myStringBuilder.Append("Sub-layer ID: " + myID.ToString + vbCrLf) Else myStringBuilder.Append("Sub-layer ID: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer AllowGeometryUpdates. Dim myAllowGeometryUpdates As Nullable(Of Boolean) = myFeatureLayerInfo.Value.AllowGeometryUpdates If myAllowGeometryUpdates IsNot Nothing Then myStringBuilder.Append("AllowGeometryUpdates: " + myAllowGeometryUpdates.ToString + vbCrLf) Else myStringBuilder.Append("AllowGeometryUpdates: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer CanModifyLayer. Dim myCanModifyLayer As Nullable(Of Boolean) = myFeatureLayerInfo.Value.CanModifyLayer If myCanModifyLayer IsNot Nothing Then myStringBuilder.Append("CanModifyLayer: " + myCanModifyLayer.ToString + vbCrLf) Else myStringBuilder.Append("CanModifyLayer: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer CanScaleSymbols. Dim myCanScaleSymbols As Nullable(Of Boolean) = myFeatureLayerInfo.Value.CanScaleSymbols If myCanScaleSymbols IsNot Nothing Then myStringBuilder.Append("CanScaleSymbols: " + myCanScaleSymbols.ToString + vbCrLf) Else myStringBuilder.Append("CanScaleSymbols: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer Capabilities. Dim myCapabilities As IEnumerable(Of String) = myFeatureLayerInfo.Value.Capabilities If myCapabilities IsNot Nothing Then myStringBuilder.Append("Capabilities: " + vbCrLf) For Each myCabability As String In myCapabilities myStringBuilder.Append("--" + myCabability + vbCrLf) Next Else myStringBuilder.Append("Capabilities: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer CopyrightText. Dim myCopyrightText As String = myFeatureLayerInfo.Value.CopyrightText If myCopyrightText IsNot Nothing Then myStringBuilder.Append("CopyrightText: " + myCopyrightText + vbCrLf) Else myStringBuilder.Append("CopyrightText: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer DefaultSpatialReference. Dim myDefaultSpatialReference As ESRI.ArcGIS.Client.Geometry.SpatialReference = myFeatureLayerInfo.Value.DefaultSpatialReference If myDefaultSpatialReference IsNot Nothing Then Dim myWKID As Nullable(Of Integer) = myDefaultSpatialReference.WKID Dim myWKT As String = myDefaultSpatialReference.WKT If myWKID IsNot Nothing Then myStringBuilder.Append("DefaultSpatialReference (WKID): " + myWKID.ToString + vbCrLf) Else myStringBuilder.Append("DefaultSpatialReference (WKT): " + myWKT + vbCrLf) End If Else myStringBuilder.Append("DefaultSpatialReference: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer LayerDefintion. Dim myDefinitionExpression As String = myFeatureLayerInfo.Value.DefinitionExpression If myDefinitionExpression IsNot Nothing Then myStringBuilder.Append("DefinitionExpression: " + myDefinitionExpression + vbCrLf) Else myStringBuilder.Append("DefinitionExpression: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer Description. Dim myDescription As String = myFeatureLayerInfo.Value.Description If myDescription IsNot Nothing Then myStringBuilder.Append("Description: " + myDescription + vbCrLf) Else myStringBuilder.Append("Description: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer DisplayField. Dim myDisplayField As String = myFeatureLayerInfo.Value.DisplayField If myDisplayField IsNot Nothing Then myStringBuilder.Append("DisplayField: " + myDisplayField + vbCrLf) Else myStringBuilder.Append("DisplayField: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer EditFieldsInfo. Dim myEditFieldsInfo As ESRI.ArcGIS.Client.FeatureService.EditFieldsInfo = myFeatureLayerInfo.Value.EditFieldsInfo If myEditFieldsInfo IsNot Nothing Then Dim myCreationDateField As String = myEditFieldsInfo.CreationDateField Dim myCreatorField As String = myEditFieldsInfo.CreatorField Dim myEditDateField As String = myEditFieldsInfo.EditDateField Dim myEditorField As String = myEditFieldsInfo.EditorField Dim myRealm As String = myEditFieldsInfo.Realm myStringBuilder.Append("EditFieldsInfo: " + vbCrLf) myStringBuilder.Append("--CreationDateField: " + myCreationDateField + vbCrLf) myStringBuilder.Append("--CreatorField: " + myCreatorField + vbCrLf) myStringBuilder.Append("--EditDateField: " + myEditDateField + vbCrLf) myStringBuilder.Append("--EditorField: " + myEditorField + vbCrLf) myStringBuilder.Append("--Realm: " + myRealm + vbCrLf) Else myStringBuilder.Append("EditFieldsInfo: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer EnableZDefaults. Dim myEnableZDefaults As Nullable(Of Boolean) = myFeatureLayerInfo.Value.EnableZDefaults If myEnableZDefaults IsNot Nothing Then myStringBuilder.Append("EnableZDefaults: " + myEnableZDefaults.ToString + vbCrLf) Else myStringBuilder.Append("EnableZDefaults: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer Extent. Dim myExtent As ESRI.ArcGIS.Client.Geometry.Envelope = myFeatureLayerInfo.Value.Extent If myExtent IsNot Nothing Then myStringBuilder.Append("Extent: " + myExtent.ToString + vbCrLf) Else myStringBuilder.Append("Extent: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer FeatureTypes. Dim myFeatureTypes As IDictionary(Of Object, ESRI.ArcGIS.Client.FeatureService.FeatureType) = myFeatureLayerInfo.Value.FeatureTypes If myFeatureTypes IsNot Nothing Then myStringBuilder.Append("FeatureTypes (Count): " + myFeatureTypes.Count.ToString + vbCrLf) For Each x As Object In myFeatureTypes Dim myFeatureType As ESRI.ArcGIS.Client.FeatureService.FeatureType = myFeatureTypes.Item(x) Dim myFT_Domains As IDictionary(Of String, ESRI.ArcGIS.Client.FeatureService.Domain) = myFeatureType.Domains Dim myFT_Id As Object = myFeatureType.Id Dim myFT_Name As String = myFeatureType.Name Dim myFT_Templates As IDictionary(Of String, ESRI.ArcGIS.Client.FeatureService.FeatureTemplate) = myFeatureType.Templates myStringBuilder.Append("--" + myFT_Name + vbCrLf) Next Else myStringBuilder.Append("FeatureTypes: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer Fields. Dim myFields As List(Of ESRI.ArcGIS.Client.Field) = myFeatureLayerInfo.Value.Fields If myFields IsNot Nothing Then myStringBuilder.Append("Fields (Count): " + myFields.Count.ToString + vbCrLf) For Each myField As ESRI.ArcGIS.Client.Field In myFields Dim myF_Alias As String = myField.Alias Dim myF_Domain As ESRI.ArcGIS.Client.FeatureService.Domain = myField.Domain Dim myF_Editable As Boolean = myField.Editable Dim myF_Length As Integer = myField.Length Dim myF_Name As String = myField.Name Dim myF_Nullable As Boolean = myField.Nullable Dim myF_Type As ESRI.ArcGIS.Client.Field.FieldType = myField.Type myStringBuilder.Append("--" + myF_Name + vbCrLf) Next Else myStringBuilder.Append("Fields: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer GeometryType. Dim myGeometryType As Nullable(Of ESRI.ArcGIS.Client.Tasks.GeometryType) = myFeatureLayerInfo.Value.GeometryType If myGeometryType IsNot Nothing Then myStringBuilder.Append("GeometryType: " + myGeometryType.ToString + vbCrLf) Else myStringBuilder.Append("GeometryType: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer GlobalIdField. Dim myGlobalIdField As String = myFeatureLayerInfo.Value.GlobalIdField If myGlobalIdField IsNot Nothing Then myStringBuilder.Append("GlobalIdField: " + myGlobalIdField + vbCrLf) Else myStringBuilder.Append("GlobalIdField: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer HasAttachments. Dim myHasAttachments As Nullable(Of Boolean) = myFeatureLayerInfo.Value.HasAttachments If myHasAttachments IsNot Nothing Then myStringBuilder.Append("HasAttachments: " + myHasAttachments.ToString + vbCrLf) Else myStringBuilder.Append("HasAttachments: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer HasLabels. Dim myHasLabels As Nullable(Of Boolean) = myFeatureLayerInfo.Value.HasLabels If myHasLabels IsNot Nothing Then myStringBuilder.Append("HasLabels: " + myHasLabels.ToString + vbCrLf) Else myStringBuilder.Append("HasLabels: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer HasM. Dim myHasM As Nullable(Of Boolean) = myFeatureLayerInfo.Value.HasM If myHasM IsNot Nothing Then myStringBuilder.Append("HasM: " + myHasM.ToString + vbCrLf) Else myStringBuilder.Append("HasM: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer HasZ. Dim myHasZ As Nullable(Of Boolean) = myFeatureLayerInfo.Value.HasZ If myHasZ IsNot Nothing Then myStringBuilder.Append("HasZ: " + myHasZ.ToString + vbCrLf) Else myStringBuilder.Append("HasZ: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer IsAddAllowed. Dim myIsAddAllowed As Nullable(Of Boolean) = myFeatureLayerInfo.Value.IsAddAllowed If myIsAddAllowed IsNot Nothing Then myStringBuilder.Append("IsAddAllowed: " + myIsAddAllowed.ToString + vbCrLf) Else myStringBuilder.Append("IsAddAllowed: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer IsDataVersioned. Dim myIsDataVersioned As Nullable(Of Boolean) = myFeatureLayerInfo.Value.IsDataVersioned If myIsDataVersioned IsNot Nothing Then myStringBuilder.Append("IsDataVersioned: " + myIsDataVersioned.ToString + vbCrLf) Else myStringBuilder.Append("IsDataVersioned: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer IsDeleteAllowed. Dim myIsDeleteAllowed As Nullable(Of Boolean) = myFeatureLayerInfo.Value.IsDeleteAllowed If myIsDeleteAllowed IsNot Nothing Then myStringBuilder.Append("IsDeleteAllowed: " + myIsDeleteAllowed.ToString + vbCrLf) Else myStringBuilder.Append("IsDeleteAllowed: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer IsReadOnly. Dim myIsReadOnly As Nullable(Of Boolean) = myFeatureLayerInfo.Value.IsReadOnly If myIsReadOnly IsNot Nothing Then myStringBuilder.Append("IsReadOnly: " + myIsReadOnly.ToString + vbCrLf) Else myStringBuilder.Append("IsReadOnly: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer IsUpdateAllowed. Dim myIsUpdateAllowed As Nullable(Of Boolean) = myFeatureLayerInfo.Value.IsUpdateAllowed If myIsUpdateAllowed IsNot Nothing Then myStringBuilder.Append("IsUpdateAllowed: " + myIsUpdateAllowed.ToString + vbCrLf) Else myStringBuilder.Append("IsUpdateAllowed: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer MaximumScale. Dim myMaximumScale As Nullable(Of Double) = myFeatureLayerInfo.Value.MaximumScale If myMaximumScale IsNot Nothing Then myStringBuilder.Append("MaximumScale: " + myMaximumScale.ToString + vbCrLf) Else myStringBuilder.Append("MaximumScale: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer MaxRecordCount. Dim myMaxRecordCount As Nullable(Of Integer) = myFeatureLayerInfo.Value.MaxRecordCount If myMaxRecordCount IsNot Nothing Then myStringBuilder.Append("MaxRecordCount: " + myMaxRecordCount.ToString + vbCrLf) Else myStringBuilder.Append("MaxRecordCount: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer MinimumScale. Dim myMinimumScale As Nullable(Of Double) = myFeatureLayerInfo.Value.MinimumScale If myMinimumScale IsNot Nothing Then myStringBuilder.Append("MinimumScale: " + myMinimumScale.ToString + vbCrLf) Else myStringBuilder.Append("MinimumScale: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer Name. Dim myName As String = myFeatureLayerInfo.Value.Name If myName IsNot Nothing Then myStringBuilder.Append("Name: " + myName + vbCrLf) Else myStringBuilder.Append("Name: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer ObjectIdField. Dim myObjectIdField As String = myFeatureLayerInfo.Value.ObjectIdField If myObjectIdField IsNot Nothing Then myStringBuilder.Append("ObjectIdField: " + myObjectIdField + vbCrLf) Else myStringBuilder.Append("ObjectIdField: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer OwnershipBasedAccessControl. Dim myOwnershipBasedAccessControl As ESRI.ArcGIS.Client.FeatureService.OwnershipBasedAccessControl = myFeatureLayerInfo.Value.OwnershipBasedAccessControl If myOwnershipBasedAccessControl IsNot Nothing Then Dim myOBAC_AllowOthersToDelete As Boolean = myOwnershipBasedAccessControl.AllowOthersToDelete Dim myOBAC_AllowOthersToUpdate As Boolean = myOwnershipBasedAccessControl.AllowOthersToUpdate myStringBuilder.Append("OwnershipBasedAccessControl (AllowOtherToDelete): " + myOBAC_AllowOthersToDelete.ToString + vbCrLf) myStringBuilder.Append("OwnershipBasedAccessControl (AllowOtherToUpdate): " + myOBAC_AllowOthersToUpdate.ToString + vbCrLf) Else myStringBuilder.Append("OwnershipBasedAccessControl: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer Relationships. Dim myRelationships As IEnumerable(Of ESRI.ArcGIS.Client.FeatureService.Relationship) = myFeatureLayerInfo.Value.Relationships If myRelationships IsNot Nothing Then myStringBuilder.Append("Relationships (Count): " + myRelationships.Count.ToString + vbCrLf) For Each myRelationship As ESRI.ArcGIS.Client.FeatureService.Relationship In myRelationships Dim myR_Cardinality As ESRI.ArcGIS.Client.FeatureService.Cardinality = myRelationship.Cardinality Dim myR_Id As Integer = myRelationship.Id Dim myR_IsComposite As Boolean = myRelationship.IsComposite Dim myR_KeyField As String = myRelationship.KeyField Dim myR_KeyFieldInRelationshipTable As String = myRelationship.KeyFieldInRelationshipTable Dim myR_Name As String = myRelationship.Name Dim myR_RelatedTableId As Integer = myRelationship.RelatedTableId Dim myR_RelationshipTableId As Integer = myRelationship.RelationshipTableId Dim myR_Role As ESRI.ArcGIS.Client.FeatureService.Role = myRelationship.Role myStringBuilder.Append("--" + myR_Name + vbCrLf) Next Else myStringBuilder.Append("Relationships: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer Renderer. Dim myRenderer As ESRI.ArcGIS.Client.IRenderer = myFeatureLayerInfo.Value.Renderer If myRenderer IsNot Nothing Then myStringBuilder.Append("Renderer: " + myRenderer.ToString + vbCrLf) Else myStringBuilder.Append("Renderer: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer SupportsAdvancedQueries. Dim mySupportsAdvancedQueries As Nullable(Of Boolean) = myFeatureLayerInfo.Value.SupportsAdvancedQueries If mySupportsAdvancedQueries IsNot Nothing Then myStringBuilder.Append("SupportsAdvancedQueries: " + mySupportsAdvancedQueries.ToString + vbCrLf) Else myStringBuilder.Append("SupportsAdvancedQueries: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer SupportsStatistics. Dim mySupportsStatistics As Nullable(Of Boolean) = myFeatureLayerInfo.Value.SupportsStatistics If mySupportsStatistics IsNot Nothing Then myStringBuilder.Append("SupportsStatistics: " + mySupportsStatistics.ToString + vbCrLf) Else myStringBuilder.Append("SupportsStatistics: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer Templates. Dim myTemplates As IDictionary(Of Object, ESRI.ArcGIS.Client.FeatureService.FeatureTemplate) = myFeatureLayerInfo.Value.Templates If myTemplates IsNot Nothing Then myStringBuilder.Append("Templates (Count): " + myTemplates.Count.ToString + vbCrLf) For Each x As Object In myTemplates Dim myTemplate As ESRI.ArcGIS.Client.FeatureService.FeatureTemplate = myTemplates.Item(x) Dim myT_Description As String = myTemplate.Description Dim myT_DrawingTool As ESRI.ArcGIS.Client.FeatureService.FeatureEditTool = myTemplate.DrawingTool Dim myT_Name As String = myTemplate.Name Dim myT_PrototypeAttributes As IDictionary(Of String, Object) = myTemplate.PrototypeAttributes Dim myT_PrototypeGeometry As ESRI.ArcGIS.Client.Geometry.Geometry = myTemplate.PrototypeGeometry myStringBuilder.Append("--" + myT_Name + vbCrLf) Next Else myStringBuilder.Append("Templates: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer Type. Dim myType As String = myFeatureLayerInfo.Value.Type If myType IsNot Nothing Then myStringBuilder.Append("Type: " + myType + vbCrLf) Else myStringBuilder.Append("Type: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer TypeIdField. Dim myTypeIdField As String = myFeatureLayerInfo.Value.TypeIdField If myTypeIdField IsNot Nothing Then myStringBuilder.Append("TypeIdField: " + myTypeIdField + vbCrLf) Else myStringBuilder.Append("TypeIdField: [Nothing/null]" + vbCrLf) End If ' Get the sub-layer ZDefault. Dim myZDefault As Nullable(Of Double) = myFeatureLayerInfo.Value.ZDefault If myZDefault IsNot Nothing Then myStringBuilder.Append("ZDefault: " + myZDefault.ToString + vbCrLf) Else myStringBuilder.Append("ZDefault: [Nothing/null]" + vbCrLf) End If myStringBuilder.Append("-------------------------" + vbCrLf) Next myFeatureLayerInfo ' Put all of the Property information about the ArcGISTiledMapServiceLayer in the TextBox. TextBox1.Text = myStringBuilder.ToString End If End Sub |
Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7, Windows 8