Table of Contents

Class ObservableConcurrentDictionary<TKey, TValue>

Namespace
Tharga.Toolkit
Assembly
Tharga.Toolkit.Standard.dll

A thread-safe dictionary that raises collection and property change notifications when items are added, removed, or modified.

public class ObservableConcurrentDictionary<TKey, TValue> : IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged

Type Parameters

TKey

The type of keys in the dictionary.

TValue

The type of values in the dictionary.

Inheritance
ObservableConcurrentDictionary<TKey, TValue>
Implements
IDictionary<TKey, TValue>
ICollection<KeyValuePair<TKey, TValue>>
IEnumerable<KeyValuePair<TKey, TValue>>
Inherited Members
Extension Methods

Properties

Count

public int Count { get; }

Property Value

int

IsReadOnly

public bool IsReadOnly { get; }

Property Value

bool

this[TKey]

public TValue this[TKey key] { get; set; }

Parameters

key TKey

Property Value

TValue

Keys

public ICollection<TKey> Keys { get; }

Property Value

ICollection<TKey>

Values

public ICollection<TValue> Values { get; }

Property Value

ICollection<TValue>

Methods

Add(KeyValuePair<TKey, TValue>)

public void Add(KeyValuePair<TKey, TValue> item)

Parameters

item KeyValuePair<TKey, TValue>

Add(TKey, TValue)

public void Add(TKey key, TValue value)

Parameters

key TKey
value TValue

Clear()

public void Clear()

Contains(KeyValuePair<TKey, TValue>)

public bool Contains(KeyValuePair<TKey, TValue> item)

Parameters

item KeyValuePair<TKey, TValue>

Returns

bool

ContainsKey(TKey)

public bool ContainsKey(TKey key)

Parameters

key TKey

Returns

bool

CopyTo(KeyValuePair<TKey, TValue>[], int)

public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)

Parameters

array KeyValuePair<TKey, TValue>[]
arrayIndex int

GetEnumerator()

public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()

Returns

IEnumerator<KeyValuePair<TKey, TValue>>

OnCollectionChanged(NotifyCollectionChangedEventArgs)

protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)

Parameters

e NotifyCollectionChangedEventArgs

OnPropertyChanged(string)

protected virtual void OnPropertyChanged(string name)

Parameters

name string

Remove(KeyValuePair<TKey, TValue>)

public bool Remove(KeyValuePair<TKey, TValue> item)

Parameters

item KeyValuePair<TKey, TValue>

Returns

bool

Remove(TKey)

public bool Remove(TKey key)

Parameters

key TKey

Returns

bool

TryGetValue(TKey, out TValue)

public bool TryGetValue(TKey key, out TValue value)

Parameters

key TKey
value TValue

Returns

bool

Events

CollectionChanged

public event NotifyCollectionChangedEventHandler CollectionChanged

Event Type

NotifyCollectionChangedEventHandler

PropertyChanged

public event PropertyChangedEventHandler PropertyChanged

Event Type

PropertyChangedEventHandler