Collection<T> Class
Represents a base type for all collection types in the GemBox.Presentation assembly.
public abstract class Collection<T> : Collection, IList, ICollection, IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable
Public MustInherit Class Collection(Of T)
Inherits Collection
Implements IList, ICollection, IList(Of T), ICollection(Of T), IEnumerable(Of T), IEnumerable
Type Parameters
T
The type of elements in the collection.
- Inheritance:
- System.ObjectCollection<T>
- Derived
Implements
Properties
Count
Gets the number of T
s contained in the collection.
Property Value
- System.Int32
The number of T
s contained in the collection.
Item[Int32]
Gets or sets the T
at the specified index.
Parameters
index
- System.Int32
The zero-based index of the T
to get or set.
Property Value
- T
The T
at the specified index.
Exceptions
- System.ArgumentOutOfRangeException
index
is less than zero or index
is equal to or greater than Count.
Methods
Add(T)
Adds a T
to the end of the collection.
Parameters
item
- T
The T
to be added to the end of the collection.
Clear()
Removes all T
s from the collection.
Contains(T)
Determines whether a T
is in the collection.
Parameters
item
- T
The T
to locate in the collection.
Returns
- System.Boolean
true if item
is found in the collection; otherwise, false.
GetEnumerator()
Returns an enumerator that iterates through the collection.
Returns
- System.Collections.Generic.IEnumerator<T>
An System.Collections.Generic.IEnumerator<T> for the collection.
IndexOf(T)
Searches for the specified T
and returns the zero-based index of the first occurrence within the entire collection.
Parameters
item
- T
The T
to locate in the collection.
Returns
- System.Int32
The zero-based index of the first occurrence of item
within the entire collection, if found; otherwise, -1.
Insert(Int32, T)
Inserts a T
to the collection at the specified index.
Parameters
index
- System.Int32
The zero-based index at which T
should be inserted.
item
- T
The T
to insert into the collection.
Exceptions
- System.ArgumentOutOfRangeException
index
is less than zero or index
is equal to or greater than Count.
Remove(T)
Removes the first occurrence of a specific T
from the collection.
Parameters
item
- T
The T
to remove from the collection.
Returns
- System.Boolean
true if item
is successfully removed; otherwise, false. This method also returns false if item
was not found in the original collection.
RemoveAt(Int32)
Removes the T
at the specified index of the collection.
Parameters
index
- System.Int32
The zero-based index of the T
to remove.
Exceptions
- System.ArgumentOutOfRangeException
index
is less than zero or index
is equal to or greater than Count.