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

A dictionary wrapper that provides ListChanging and ListChanged events. You can also implement custom behavior by overriding its methods. More...


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

Remarks

A dictionary wrapper that provides ListChanging and ListChanged events. You can also implement custom behavior by overriding its methods.

The Keys and Values properties return ICollection, but this class assumes that mutating these collections is not allowed (mutating them is not allowed, for example, by Dictionary{K,V}). Therefore change notification is not implemented for changes to these collections; these properties simply return the original collection.

See also
ListWrapper<TList,T>
Type Constraints
TDictionary :IDictionary 
TDictionary :K 
TDictionary :V 

Public fields

bool IsEmpty => _obj.Count == 0
 
- Public fields inherited from Loyc.Collections.Impl.DictionaryWrapper< K, V, TDictionary >
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

override V?? this[K key] [get, set]
 
- Properties inherited from Loyc.Collections.Impl.DictionaryWrapper< K, V, TDictionary >
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

 DictionaryWithChangeEvents (TDictionary dictionary)
 
virtual bool TryAdd (K key, V value)
 
override void Add (KeyValuePair< K, V > item)
 
override void Add (K key, V value)
 
override void Clear ()
 
override bool Remove (KeyValuePair< K, V > item)
 
override bool Remove (K key)
 
virtual void AddRange (IEnumerable< KeyValuePair< K, V >> list)
 
virtual void AddRange (IReadOnlyCollection< KeyValuePair< K, V >> list)
 
- Public Member Functions inherited from Loyc.Collections.Impl.DictionaryWrapper< K, V, TDictionary >
 DictionaryWrapper (TDictionary dictionary)
 
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 bool Remove (T item)
 
virtual bool Contains (T item)
 
virtual void CopyTo (T[] array, int arrayIndex)
 
virtual IEnumerator< T > GetEnumerator ()
 

Events

virtual ListChangingHandler< KeyValuePair< K, V >, IDictionary< K, V > > ListChanging
 
virtual ListChangingHandler< KeyValuePair< K, V >, IDictionary< K, V > > ListChanged
 

Additional Inherited Members

- Protected fields inherited from Loyc.Collections.Impl.DictionaryWrapper< K, V, TDictionary >
TDictionary Dictionary => _obj
 
- Protected fields inherited from Loyc.Collections.Impl.CollectionWrapper< KeyValuePair< K, V >, TDictionary >
TCollection Collection