Class CompositionList<T>
- Namespace
- NMF.Models.Collections
- Assembly
- NMF.Models.dll
Denotes the base class for a composition list
public class CompositionList<T> : Collection<T>, IList<T>, ICollection<T>, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable where T : class, IModelElement
Type Parameters
TThe type of elements
- Inheritance
-
Collection<T>CompositionList<T>
- Implements
-
IList<T>ICollection<T>IEnumerable<T>
- Inherited Members
Constructors
CompositionList(ModelElement)
Create a new instance
public CompositionList(ModelElement parent)
Parameters
parentModelElementThe parent model element
Exceptions
- ArgumentNullException
Thrown if the parent is null
Properties
Parent
Gets the parent model element
public ModelElement Parent { get; }
Property Value
Methods
ClearItems()
Removes all elements from the Collection<T>.
protected override void ClearItems()
InsertItem(int, T)
Inserts an element into the Collection<T> at the specified index.
protected override void InsertItem(int index, T item)
Parameters
indexintThe zero-based index at which
itemshould be inserted.itemTThe object to insert. The value can be null for reference types.
Exceptions
- ArgumentOutOfRangeException
<code class="paramref">index</code> is less than zero.-or-
indexis greater than Count.
RemoveItem(int)
Removes the element at the specified index of the Collection<T>.
protected override void RemoveItem(int index)
Parameters
indexintThe zero-based index of the element to remove.
Exceptions
- ArgumentOutOfRangeException
<code class="paramref">index</code> is less than zero.-or-
indexis equal to or greater than Count.
SetItem(int, T)
Replaces the element at the specified index.
protected override void SetItem(int index, T item)
Parameters
indexintThe zero-based index of the element to replace.
itemTThe new value for the element at the specified index. The value can be null for reference types.
Exceptions
- ArgumentOutOfRangeException
<code class="paramref">index</code> is less than zero.-or-
indexis greater than Count.