Class ObservableDictionary<TKey, TValue>
- Namespace
- Ecng.ComponentModel
- Assembly
- Ecng.ComponentModel.dll
public class ObservableDictionary<TKey, TValue> : IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable, ISerializable, IDeserializationCallback, INotifyCollectionChanged, INotifyPropertyChanged
Type Parameters
TKey
TValue
- Inheritance
-
ObservableDictionary<TKey, TValue>
- Implements
-
- Inherited Members
-
- Extension Methods
-
Constructors
ObservableDictionary()
public ObservableDictionary()
ObservableDictionary(IDictionary<TKey, TValue>)
public ObservableDictionary(IDictionary<TKey, TValue> dictionary)
Parameters
dictionary
IDictionary<TKey, TValue>
ObservableDictionary(IDictionary<TKey, TValue>, IEqualityComparer<TKey>)
public ObservableDictionary(IDictionary<TKey, TValue> dictionary, IEqualityComparer<TKey> comparer)
Parameters
dictionary
IDictionary<TKey, TValue>
comparer
IEqualityComparer<TKey>
ObservableDictionary(IEqualityComparer<TKey>)
public ObservableDictionary(IEqualityComparer<TKey> comparer)
Parameters
comparer
IEqualityComparer<TKey>
ObservableDictionary(SerializationInfo, StreamingContext)
protected ObservableDictionary(SerializationInfo info, StreamingContext context)
Parameters
info
SerializationInfo
context
StreamingContext
Properties
Comparer
public IEqualityComparer<TKey> Comparer { get; }
Property Value
- IEqualityComparer<TKey>
Count
public int Count { get; }
Property Value
- int
this[TKey]
public TValue this[TKey key] { get; set; }
Parameters
key
TKey
Property Value
- TValue
Keys
public Dictionary<TKey, TValue>.KeyCollection Keys { get; }
Property Value
- Dictionary<TKey, TValue>.KeyCollection
Values
public Dictionary<TKey, TValue>.ValueCollection Values { get; }
Property Value
- Dictionary<TKey, TValue>.ValueCollection
Methods
Add(TKey, TValue)
public void Add(TKey key, TValue value)
Parameters
key
TKey
value
TValue
AddEntry(TKey, TValue)
protected virtual bool AddEntry(TKey key, TValue value)
Parameters
key
TKey
value
TValue
Returns
- bool
Clear()
ClearEntries()
protected virtual bool ClearEntries()
Returns
- bool
ContainsKey(TKey)
public bool ContainsKey(TKey key)
Parameters
key
TKey
Returns
- bool
ContainsValue(TValue)
public bool ContainsValue(TValue value)
Parameters
value
TValue
Returns
- bool
GetEnumerator()
public IEnumerator GetEnumerator()
Returns
- IEnumerator
GetIndexAndEntryForKey(TKey, out DictionaryEntry)
protected int GetIndexAndEntryForKey(TKey key, out DictionaryEntry entry)
Parameters
key
TKey
entry
DictionaryEntry
Returns
- int
GetObjectData(SerializationInfo, StreamingContext)
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
info
SerializationInfo
context
StreamingContext
OnCollectionChanged(NotifyCollectionChangedEventArgs)
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
Parameters
args
NotifyCollectionChangedEventArgs
OnDeserialization(object)
public virtual void OnDeserialization(object sender)
Parameters
sender
object
OnPropertyChanged(string)
protected virtual void OnPropertyChanged(string name)
Parameters
name
string
Remove(TKey)
public bool Remove(TKey key)
Parameters
key
TKey
Returns
- bool
RemoveEntry(TKey)
protected virtual bool RemoveEntry(TKey key)
Parameters
key
TKey
Returns
- bool
SetEntry(TKey, TValue)
protected virtual bool SetEntry(TKey key, TValue value)
Parameters
key
TKey
value
TValue
Returns
- bool
TryGetValue(TKey, out TValue)
public bool TryGetValue(TKey key, out TValue value)
Parameters
key
TKey
value
TValue
Returns
- bool
Events
CollectionChanged
protected virtual event NotifyCollectionChangedEventHandler CollectionChanged
Event Type
- NotifyCollectionChangedEventHandler
PropertyChanged
protected virtual event PropertyChangedEventHandler PropertyChanged
Event Type
- PropertyChangedEventHandler