ElementCollection Class
Represents a base non-generic class for Element collections.
public abstract class ElementCollection : IList, ICollection, IEnumerable
Public MustInherit Class ElementCollection
Implements IList, ICollection, IEnumerable
- Inheritance:
- System.ObjectElementCollection
- Derived
Implements
Remarks
ElementCollection has a covariant public interface, meaning that it contains only common collection methods that are typesafe (methods that do not accept Element derived parameters). To access all collection methods in a non-typesafe way, cast an ElementCollection to an System.Collections.IList and use System.Collections.IList's members.
Properties
Content
Gets the content of the current ElementCollection.
Property Value
The content of the current ElementCollection.
Remarks
For more information, see Get Content example.
Count
Gets the number of elements contained in the ElementCollection.
Property Value
- System.Int32
The number of elements contained in the ElementCollection.
Item[Int32]
Gets the Element at the specified index.
public Element this[int index] { get; }
Public ReadOnly Property Item(index As Integer) As Element
Parameters
index
- System.Int32
The zero-based index of the Element to get.
Property Value
SupportedElementTypes
Gets a sequence of ElementTypes that can be contained in this collection.
public IEnumerable<ElementType> SupportedElementTypes { get; }
Public ReadOnly Property SupportedElementTypes As IEnumerable(Of ElementType)
Property Value
- System.Collections.Generic.IEnumerable<ElementType>
A sequence of ElementTypes that can be contained in this collection.
Methods
Clear()
Removes all elements from the ElementCollection.
CopyTo(Element[], Int32)
Copies the elements of the ElementCollection to an System.Array, starting at a particular System.Array index.
public void CopyTo(Element[] array, int arrayIndex)
Public Sub CopyTo(array As Element(), arrayIndex As Integer)
Parameters
array
- Element[]
The one-dimensional System.Array that is the destination of the elements copied from ElementCollection. The System.Array must have zero-based indexing.
arrayIndex
- System.Int32
The zero-based index in array
at which copying begins.
GetEnumerator()
Returns an enumerator that iterates through a collection.
public IEnumerator<Element> GetEnumerator()
Public Function GetEnumerator As IEnumerator(Of Element)
Returns
- System.Collections.Generic.IEnumerator<Element>
An System.Collections.Generic.IEnumerator<T> object that can be used to iterate through the collection.
IndexOf(Element)
Determines the index of a specific Element in the ElementCollection.
Parameters
item
- Element
The Element to locate in the ElementCollection.
Returns
- System.Int32
The index of Element if found in the ElementCollection; otherwise, -1.
RemoveAt(Int32)
Removes the element at the specified index of the ElementCollection.
Parameters
index
- System.Int32
The zero-based index of the element to remove.