NanoByte.Common
2.6.1
|
A collection that can easily be monitored for changes via events. More...
Public Member Functions | |
MonitoredCollection () | |
Creates a new monitored collection. More... | |
MonitoredCollection (int maxElements) | |
Creates a new monitored collection with an upper limit to the number of elements. More... | |
void | AddMany (IEnumerable< T > collection) |
Adds all the items in collection to the collection that weren't already there. More... | |
void | SetMany (IEnumerable< T > enumeration) |
Adds all the items in enumeration to the collection that weren't already there and removes all items in the collection that are not in enumeration . More... | |
Protected Member Functions | |
override void | InsertItem (int index, T item) |
override void | SetItem (int index, T item) |
override void | RemoveItem (int index) |
override void | ClearItems () |
Properties | |
int | MaxElements [get] |
The maximum number of elements; 0 for no limit. More... | |
Events | |
Action? | Changed |
Occurs whenever something in the collection changes. More... | |
Action< T >? | Added |
Occurs when a new item has just been added to the collection. More... | |
Action< T >? | Removing |
Occurs when an item is just about to be removed from the collection. More... | |
Action< T >? | Removed |
Occurs when an item has just been removed from the collection. More... | |
A collection that can easily be monitored for changes via events.
T | The type of elements in the collection. |
|
inline |
Creates a new monitored collection.
|
inline |
Creates a new monitored collection with an upper limit to the number of elements.
maxElements | The maximum number of elements; 0 for no limit. |
|
inline |
Adds all the items in collection to the collection that weren't already there.
collection | A collection of items to add to the collection. |
All events are raised en bloc after the items have been added.
After calling this method this collection will contain a superset of the items in collection , but not necessarily in the same order.
|
inline |
Adds all the items in enumeration to the collection that weren't already there and removes all items in the collection that are not in enumeration .
enumeration | An enumeration with items to add to the collection. |
All events are raised en bloc after the items have been added.
After calling this method this collection will contain the same items as enumeration , but not necessarily in the same order.
|
get |
The maximum number of elements; 0 for no limit.
Action<T>? NanoByte.Common.Collections.MonitoredCollection< T >.Added |
Occurs when a new item has just been added to the collection.
Action? NanoByte.Common.Collections.MonitoredCollection< T >.Changed |
Occurs whenever something in the collection changes.
Action<T>? NanoByte.Common.Collections.MonitoredCollection< T >.Removed |
Occurs when an item has just been removed from the collection.
Action<T>? NanoByte.Common.Collections.MonitoredCollection< T >.Removing |
Occurs when an item is just about to be removed from the collection.