Enhanced C#
Language of your choice: library documentation
|
A collection wrapper that provides ListChanging and ListChanged events. You can also implement custom behavior by overriding its methods. More...
A collection wrapper that provides ListChanging and ListChanged events. You can also implement custom behavior by overriding its methods.
This class is designed to support both sets and other collection types. If the underlying collection implements ISet<T>, the Add method avoids firing change notification events if the requested item is already in the set. Regardless of whether the collection is a set, the Remove method also avoids firing any notifications when the requested item is not in the collection.
T | Type of each list item |
TColl | Type of the underlying collection |
TColl | : | ICollection<T> |
Public fields | |
ISet< T > | _asSet |
bool | IsEmpty => Count == 0 |
Public fields inherited from Loyc.Collections.Impl.CollectionWrapper< T, TColl > | |
virtual int | Count |
virtual bool | IsReadOnly |
Public Member Functions | |
override void | Add (T item) |
virtual bool | TryAdd (T item) |
Synonym for Add(). If the collection implements ISet{T}, this method returns false if the item is already present in the set; otherwise it always returns true. More... | |
override void | Clear () |
override bool | Remove (T item) |
Public Member Functions inherited from Loyc.Collections.Impl.CollectionWrapper< T, TColl > | |
CollectionWrapper (TCollection collection) | |
virtual bool | Contains (T item) |
virtual void | CopyTo (T[] array, int arrayIndex) |
virtual IEnumerator< T > | GetEnumerator () |
Events | |
CollectionWithChangeEvents(TColl wrappedObject) virtual ListChangingHandler< T, ICollection< T > > | ListChanging |
virtual ListChangingHandler< T, ICollection< T > > | ListChanged |
Additional Inherited Members | |
Protected fields inherited from Loyc.Collections.Impl.CollectionWrapper< T, TColl > | |
TCollection | Collection |
|
inlinevirtual |
Synonym for Add(). If the collection implements ISet{T}, this method returns false if the item is already present in the set; otherwise it always returns true.