CodeObjectCollection<T> Class
Represents a collection of code objects that automatically manages parent-child relationships.
public class CodeObjectCollection<T> : CodeObject, ICollection<T>, IEnumerable<T>, IList<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, IEnumerable where T : CodeObjectType parameters
T- The type of code objects in the collection.
- Inheritance
CodeObjectCodeObjectCollection<T>- Implements
Constructors
| Name | Description |
|---|---|
| CodeObjectCollection() | |
| CodeObjectCollection(CodeObject) | Initializes a new instance of the CodeObjectCollection<T> class with the specified parent. |
CodeObjectCollection overloads
CodeObjectCollection()
CodeObjectCollection.cspublic CodeObjectCollection()No documentation is available.
CodeObjectCollection(CodeObject)
CodeObjectCollection.csInitializes a new instance of the CodeObjectCollection<T> class with the specified parent.
public CodeObjectCollection(CodeObject parent)Parameters
parentCodeObject- The parent code object.
Properties
| Name | Description |
|---|---|
| Count | Gets the number of items in the collection. |
| IsReadOnly | Gets a value indicating whether the collection is read-only. |
IsReadOnly
CodeObjectCollection.csIndexers
| Name | Description |
|---|---|
| this[int] | Gets or sets the item at the specified index. |
this[int]
CodeObjectCollection.csMethods
| Name | Description |
|---|---|
| Add<TCodeObject>(TCodeObject) | Adds an item to the collection and returns it. |
| AddRange(IEnumerable<T>) | Adds a range of items to the collection. |
| Clear() | |
| Contains(T) | |
| CopyTo(T[], int) | |
| GetEnumerator() | |
| IndexOf(T) | |
| Insert(int, T) | |
| Remove(T) | |
| RemoveAt(int) | |
| Sort(IComparer<T>) | Sorts the elements in the collection using the specified comparer. |
| System.Collections.Generic.ICollection<T>.Add(T) | |
| System.Collections.IEnumerable.GetEnumerator() |
Add<TCodeObject>(TCodeObject)
CodeObjectCollection.csAdds an item to the collection and returns it.
public TCodeObject Add<TCodeObject>(TCodeObject item) where TCodeObject : TType parameters
TCodeObject- The type of the code object to add.
Parameters
itemTCodeObject- The item to add.
Returns
TCodeObject The added item.
AddRange(IEnumerable<T>)
CodeObjectCollection.csAdds a range of items to the collection.
public void AddRange(IEnumerable<T> items)Parameters
itemsIEnumerable<T>- The items to add.
Clear()
CodeObjectCollection.cspublic void Clear()No documentation is available.
Contains(T)
CodeObjectCollection.csCopyTo(T[], int)
CodeObjectCollection.csGetEnumerator()
CodeObjectCollection.csIndexOf(T)
CodeObjectCollection.csInsert(int, T)
CodeObjectCollection.csRemove(T)
CodeObjectCollection.csRemoveAt(int)
CodeObjectCollection.csSort(IComparer<T>)
CodeObjectCollection.csSorts the elements in the collection using the specified comparer.
Parameters
comparerIComparer<T>- The comparer to use for sorting.