Enhanced C#
Language of your choice: library documentation
Public fields | Properties | Public Member Functions | Protected fields | List of all members
Loyc.Collections.Impl.DictionaryWrapper< K, V, TDictionary > Class Template Reference

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...


Source file:
Inheritance diagram for Loyc.Collections.Impl.DictionaryWrapper< K, V, TDictionary >:
Loyc.Collections.Impl.CollectionWrapper< KeyValuePair< K, V >, TDictionary > Loyc.Collections.IDictionaryAndReadOnly< K, V > Loyc.Collections.IIndexed< K, V > Loyc.Collections.Impl.DictionaryWithChangeEvents< K, V, TDictionary >

Remarks

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 

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 >
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