Enhanced C#
Language of your choice: library documentation
|
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.
TDictionary | : | IDictionary | |
TDictionary | : | K | |
TDictionary | : | V |
Public fields | |
virtual ICollection< K > | Keys => _obj.Keys |
virtual ICollection< V > | Values => _obj.Values |
Public fields inherited from Loyc.Collections.Impl.CollectionWrapper< KeyValuePair< K, V >, TDictionary > | |
virtual int | Count |
virtual bool | IsReadOnly |
Properties | |
virtual V | this[K key] [get, set] |
Properties inherited from Loyc.Collections.IIndexed< K, V > | |
V | this[K key] [get] |
Gets the value associated with the specified key. More... | |
Public Member Functions | |
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, out V value) |
Public Member Functions inherited from Loyc.Collections.Impl.CollectionWrapper< KeyValuePair< K, V >, TDictionary > | |
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 () |
Protected fields | |
TDictionary | Dictionary => _obj |
Protected fields inherited from Loyc.Collections.Impl.CollectionWrapper< KeyValuePair< K, V >, TDictionary > | |
TCollection | Collection |