Class ChangeAwareDictionary<TKey, TValue>
- Namespace
- NMF.Expressions
- Assembly
- NMF.Expressions.Utilities.dll
Provides a notifiable associative memory
public class ChangeAwareDictionary<TKey, TValue>
Type Parameters
TKey
The type of the keys
TValue
The type of the values
- Inheritance
-
ChangeAwareDictionary<TKey, TValue>
- Inherited Members
- Extension Methods
Constructors
ChangeAwareDictionary()
Creates a new change-aware dictionary
public ChangeAwareDictionary()
ChangeAwareDictionary(ChangeAwareDictionary<TKey, TValue>)
Creates a new change-aware dictionary based on a template
public ChangeAwareDictionary(ChangeAwareDictionary<TKey, TValue> template)
Parameters
template
ChangeAwareDictionary<TKey, TValue>The template dictionary
ChangeAwareDictionary(IEqualityComparer<TKey>)
Creates a new change-aware dictionary
public ChangeAwareDictionary(IEqualityComparer<TKey> comparer)
Parameters
comparer
IEqualityComparer<TKey>The comparer that should be used to compare dictionary entries
Properties
this[TKey]
Gets or sets a value for the given key
public TValue this[TKey key] { get; set; }
Parameters
key
TKeyThe key element
Property Value
- TValue
The current value for the given key
Methods
AsNotifiable(TKey)
Gets an object that tracks the current value for the given key
public INotifyReversableValue<TValue> AsNotifiable(TKey key)
Parameters
key
TKeyThe given key
Returns
- INotifyReversableValue<TValue>
An object that tracks the current value and notifies clients when this value changes
Forget(TKey)
Forgets the notifiable value for the given key
public bool Forget(TKey key)
Parameters
key
TKeyThe key object
Returns
- bool
True, if there was an element for the given key, otherwise false