GemBox.Document
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    ElementCollection Class

    Namespace:
    GemBox.Document
    Assembly:
    GemBox.Document.dll

    Represents a base non-generic class for Element collections.

    • C#
    • VB.NET
    public abstract class ElementCollection : IList, ICollection, IEnumerable
    Public MustInherit Class ElementCollection
        Implements IList, ICollection, IEnumerable
    Inheritance:
    System.Object
    ElementCollection
    Derived
    CommentCollection
    ElementCollection<T>
    Implements
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.IEnumerable
    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.

    • C#
    • VB.NET
    public ContentRange Content { get; }
    Public ReadOnly Property Content As ContentRange
    Property Value
    ContentRange

    The content of the current ElementCollection.

    Remarks

    For more information, see Get Content example.

    Count

    Gets the number of elements contained in the ElementCollection.

    • C#
    • VB.NET
    public int Count { get; }
    Public ReadOnly Property Count As Integer
    Property Value
    System.Int32

    The number of elements contained in the ElementCollection.

    Item[Int32]

    Gets the Element at the specified index.

    • C#
    • VB.NET
    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
    Element

    The Element at the specified index.

    SupportedElementTypes

    Gets a sequence of ElementTypes that can be contained in this collection.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    public void Clear()
    Public Sub Clear

    CopyTo(Element[], Int32)

    Copies the elements of the ElementCollection to an System.Array, starting at a particular System.Array index.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    public int IndexOf(Element item)
    Public Function IndexOf(item As Element) As Integer
    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.

    • C#
    • VB.NET
    public void RemoveAt(int index)
    Public Sub RemoveAt(index As Integer)
    Parameters
    index
    System.Int32

    The zero-based index of the element to remove.

    Implements

    System.Collections.IList
    System.Collections.ICollection
    System.Collections.IEnumerable

    Examples

    Get Content example
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.