Class ObjectCollectionT<T>
- Namespace
- ArcanaDevelopment.adTempus.Client.Collections
- Assembly
- ArcanaDevelopment.adTempus.Client.dll
public abstract class ObjectCollectionT<T> where T : ObjectBase
Type Parameters
| Name | Description |
|---|---|
T |
- Inheritance
-
objectObjectCollectionT<T>
- Derived
Fields
Collection
protected List<T> Collection
Field Value
- List<T>
Properties
Count
Gets the number of elements contained in the System.Collections.Generic.ICollection<T>.
public int Count { get; }
Property Value
- int
The number of elements contained in the System.Collections.Generic.ICollection<T>.
IsReadOnly
Gets a value indicating whether the System.Collections.Generic.ICollection<T> is read-only.
public bool IsReadOnly { get; }
Property Value
this[int]
public virtual T this[int index] { get; }
Parameters
| Name | Type | Description |
|---|---|---|
index |
int |
Property Value
- T
Methods
Add(T)
Adds an item to the System.Collections.Generic.ICollection<T>.
public virtual void Add(T item)
Parameters
| Name | Type | Description |
|---|---|---|
item |
T | The object to add to the System.Collections.Generic.ICollection<T>. |
Exceptions
- NotSupportedException
The System.Collections.Generic.ICollection<T> is read-only.
CheckReadOnlyAndThrow()
Throws an exception if the collection is read-only.
protected void CheckReadOnlyAndThrow()
Clear()
Removes all items from the System.Collections.Generic.ICollection<T>.
public virtual void Clear()
Exceptions
- NotSupportedException
The System.Collections.Generic.ICollection<T> is read-only.
Contains(T)
Determines whether the System.Collections.Generic.ICollection<T> contains a specific value.
public virtual bool Contains(T item)
Parameters
| Name | Type | Description |
|---|---|---|
item |
T | The object to locate in the System.Collections.Generic.ICollection<T>. |
Returns
CopyTo(T[], int)
Copies the elements of the System.Collections.Generic.ICollection<T> to an System.Array, starting at a particular System.Array index.
public void CopyTo(T[] array, int arrayIndex)
Parameters
| Name | Type | Description |
|---|---|---|
array |
T[] | The one-dimensional System.Array that is the destination of the elements copied from System.Collections.Generic.ICollection<T>. The System.Array must have zero-based indexing. |
arrayIndex |
int | The zero-based index in |
Exceptions
- ArgumentNullException
arrayis null.- ArgumentOutOfRangeException
arrayIndexis less than 0.- ArgumentException
The number of elements in the source System.Collections.Generic.ICollection<T> is greater than the available space from
arrayIndexto the end of the destinationarray.
IndexOf(T)
public int IndexOf(T item)
Parameters
| Name | Type | Description |
|---|---|---|
item |
T |
Returns
- int
Insert(int, T)
public virtual void Insert(int index, T item)
Parameters
| Name | Type | Description |
|---|---|---|
index |
int | |
item |
T |
Remove(T)
Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection<T>.
public virtual bool Remove(T item)
Parameters
| Name | Type | Description |
|---|---|---|
item |
T | The object to remove from the System.Collections.Generic.ICollection<T>. |
Returns
- bool
true if
itemwas successfully removed from the System.Collections.Generic.ICollection<T>; otherwise, false. This method also returns false ifitemis not found in the original System.Collections.Generic.ICollection<T>.
Exceptions
- NotSupportedException
The System.Collections.Generic.ICollection<T> is read-only.
RemoveAt(int)
public virtual void RemoveAt(int index)
Parameters
| Name | Type | Description |
|---|---|---|
index |
int |