Class ObservableConcurrentDictionary<TKey, TValue>
Provides a thread-safe dictionary for use with data binding.
Inheritance
Implements
Namespace: ISynergy.Framework.Core.Collections
Assembly: ISynergy.Framework.Core.dll
Syntax
public class ObservableConcurrentDictionary<TKey, TValue> : IDictionary<TKey, TValue>
Type Parameters
Name | Description |
---|---|
TKey | Specifies the type of the keys in this collection. |
TValue | Specifies the type of the values in this collection. |
Constructors
View SourceObservableConcurrentDictionary()
Initializes an instance of the ObservableConcurrentDictionary class.
Declaration
public ObservableConcurrentDictionary()
Properties
View SourceItem[TKey]
Gets or sets the
Declaration
public TValue this[TKey key] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
TKey | key | The key. |
Property Value
Type | Description |
---|---|
TValue | TValue. |
Keys
Gets an System.Collections.Generic.ICollection<T> containing the keys of the System.Collections.Generic.IDictionary<TKey, TValue>.
Declaration
public ICollection<TKey> Keys { get; }
Property Value
Type | Description |
---|---|
ICollection<TKey> | The keys. |
Values
Gets an System.Collections.Generic.ICollection<T> containing the values in the System.Collections.Generic.IDictionary<TKey, TValue>.
Declaration
public ICollection<TValue> Values { get; }
Property Value
Type | Description |
---|---|
ICollection<TValue> | The values. |
Methods
View SourceAdd(TKey, TValue)
Adds an element with the provided key and value to the System.Collections.Generic.IDictionary<TKey, TValue>.
Declaration
public void Add(TKey key, TValue value)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | The object to use as the key of the element to add. |
TValue | value | The object to use as the value of the element to add. |
ContainsKey(TKey)
Determines whether the System.Collections.Generic.IDictionary<TKey, TValue> contains an element with the specified key.
Declaration
public bool ContainsKey(TKey key)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | The key to locate in the System.Collections.Generic.IDictionary<TKey, TValue>. |
Returns
Type | Description |
---|---|
System.Boolean | true if the System.Collections.Generic.IDictionary<TKey, TValue> contains an element with the key; otherwise, false. |
Remove(TKey)
Removes the element with the specified key from the System.Collections.Generic.IDictionary<TKey, TValue>.
Declaration
public bool Remove(TKey key)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | The key of the element to remove. |
Returns
Type | Description |
---|---|
System.Boolean | true if the element is successfully removed; otherwise, false. This method also returns false if |
TryGetValue(TKey, out TValue)
Gets the value associated with the specified key.
Declaration
public bool TryGetValue(TKey key, out TValue value)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | The key whose value to get. |
TValue | value | When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. |
Returns
Type | Description |
---|---|
System.Boolean | true if the object that implements System.Collections.Generic.IDictionary<TKey, TValue> contains an element with the specified key; otherwise, false. |
Events
View SourceCollectionChanged
Event raised when the collection changes.
Declaration
public event NotifyCollectionChangedEventHandler CollectionChanged
Event Type
Type | Description |
---|---|
NotifyCollectionChangedEventHandler |
PropertyChanged
Event raised when a property on the collection changes.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type | Description |
---|---|
PropertyChangedEventHandler |