A simple base class that helps you use the decorator pattern on a dictionary. By default, all it does is forward every method to the underlying collection (including GetHashCode, Equals and ToString). You can change its behavior by overriding methods.
More...
A simple base class that helps you use the decorator pattern on a dictionary. By default, all it does is forward every method to the underlying collection (including GetHashCode, Equals and ToString). You can change its behavior by overriding methods.
This could be used, for example, to help you implement a collection that needs to take some kind of action whenever the collection is modified.
- See also
- ListWrapper{TList,T}, DictionaryWithChangeEvents{TDictionary, K, V}
- Type Constraints
-
| TDictionary | : | IDictionary | |
| TDictionary | : | K | |
| TDictionary | : | V | |
|
|
| DictionaryWrapper (TDictionary dictionary) |
| |
|
virtual void | Add (K key, V value) |
| |
|
virtual bool | Remove (K key) |
| |
|
virtual bool | ContainsKey (K key) |
| |
|
virtual bool | TryGetValue (K key, [MaybeNullWhen(false)] out V value) |
| |
|
V | TryGet (K key, out bool fail) |
| |
|
| CollectionWrapper (TCollection collection) |
| |
|
virtual void | Add (T item) |
| |
|
virtual void | Clear () |
| |
|
virtual bool | Remove (T item) |
| |
|
virtual bool | Contains (T item) |
| |
|
virtual void | CopyTo (T[] array, int arrayIndex) |
| |
|
virtual IEnumerator< T > | GetEnumerator () |
| |
| override bool | Equals (object?obj) |
| | Returns true iff the parameter 'obj' is a wrapper around an object that is equal to the object that this object wraps. More...
|
| |
| override int | GetHashCode () |
| | Returns the hashcode of the wrapped object. More...
|
| |
| override string | ToString () |
| | Returns ToString() of the wrapped object. More...
|
| |