Table of Contents

Class AdvDictionary<TKey, TValue>

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

Adds additional functionality to the ConcurrentDictionary<TKey, TValue>.

public class AdvDictionary<TKey, TValue> : ConcurrentDictionary<TKey, TValue>, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable where TKey : notnull

Type Parameters

TKey

The type of the keys in the dictionary.

TValue

The type of the values in the dictionary.

Inheritance
ConcurrentDictionary<TKey, TValue>
AdvDictionary<TKey, TValue>
Implements
IDictionary<TKey, TValue>
ICollection<KeyValuePair<TKey, TValue>>
IReadOnlyDictionary<TKey, TValue>
IEnumerable<KeyValuePair<TKey, TValue>>
Derived

Methods

Add(TKey, TValue)

Adds the specified key and value pair to the dictionary or updates value if key is already added.

GetOrCreate(TKey, Func<TValue>)

Gets the value associated with the specified key. If the key is not found in the dictionary, it is added there with the value provided by func.

GetValueOrDefault(TKey, Func<TValue>)

Gets the value associated with the specified key. Returns a result of func function call if the key is not found.

GetValueOrDefault(TKey, TValue)

Gets the value associated with the specified key. Returns defaultValue if the key is not found.

Remove(TKey)

Attempts to remove and return the value that has the specified key from the ditionary.