ESRI.ArcGIS.ADF.IMS
RemoveAt Method
See Also  Example
ESRI.ArcGIS.ADF.IMS.Display.AcetateElement Namespace > AcetateElementCollection Class : RemoveAt Method




index
The zero-based index location of the AcetateElement to be removed.
Removes an AcetateElement from a specific index in a collection.

Syntax

Visual Basic (Declaration) 
Public Sub RemoveAt( _
   ByVal index As Integer _
) 
Visual Basic (Usage)Copy Code
Dim instance As AcetateElementCollection
Dim index As Integer
 
instance.RemoveAt(index)
C# 
public void RemoveAt( 
   int index
)

Parameters

index
The zero-based index location of the AcetateElement to be removed.

Example

This example adds an element to an existing acetate layer, then removes the first element in the collection. Note this will be the element we just added only if it is the only element in the collection.
Visual BasicCopy Code
' Add a previously created element to an existing acetate layer

acetateLayer.AcetateElements.Add(acetatePt)



' Add acetate layer to the map

mapView.Layers.Add(acetateLayer)



' Remove the first acetate graphic from the layer

acetateLayer.AcetateElements.RemoveAt(0)

C#Copy Code
// Add a previously created element to an existing acetate layer 

acetateLayer.AcetateElements.Add(acetatePt) 

  

// Add acetate layer to the map 

mapView.Layers.Add(acetateLayer) 

  

// Remove the first acetate graphic from the layer 

acetateLayer.AcetateElements.RemoveAt(0) 

    

Remarks

RemoveAt allows you to remove an element from an acetate layer's collection by the position of the element.

If you remove all elements from an acetate layer's AcetateElementCollection, the acetate layer should be removed from the map as well. Otherwise, a runtime error will be thrown for an empty collection.

See Also

© 2010 All Rights Reserved.