Namespace TallComponents.Interaction
Class Collection<TElement>
A collection that raises events when elements are added or removed.
Elements are stored in a particular order, i.e. they have position in the collection and can be addressed by index. Duplicate elements are avoided. If an element is added that already exists, it will be moved to the new position.
Syntax
public class Collection<TElement> : Object,ICollection<TElement>,IEnumerable<TElement>,IList<TElement>
Constructors
Properties
Int32 Count
Return the number of interactors in the collection.
Boolean IsReadOnly
Returns false, to indicate that an collection is writable.
TElement Item
Return the i-th element in the collection.
Methods
Void Add(TElement)
Adds an element to the collection.
Void AddRange(TElement[])
Add an array of elements.
Void Clear()
Clears the collection.
Boolean Contains(TElement)
Returns true if the list contains the given element.
Void CopyTo(TElement[],Int32)
Copies the elements of the collection to the specified array.
IEnumerator<TElement> GetEnumerator()
Returns an iterator for the collection.
Int32 IndexOf(TElement)
Get the index of the given element in the collection.
Void Insert(Int32,TElement)
Insert an element at a particular index.
Boolean Remove(TElement)
Remove a particular element from the collection.
Void RemoveAt(Int32)
Removes the interactor at the given index.
Void Set(TElement)
Set the collection to hold only the given element.
Events
Inserted
The Inserted event will be fired whenever a new element has been inserted
into to the collection.
Removed
The Removed event will be fired whenever an element has been removed
from the collection.