Class AutoDictionary<TKey, TValue>
Dictionary with support for automatic instantiation of non-existent keys.
Implements
IDictionary<TKey, TValue>
ICollection<KeyValuePair<TKey, TValue>>
IReadOnlyDictionary<TKey, TValue>
IReadOnlyCollection<KeyValuePair<TKey, TValue>>
IEnumerable<KeyValuePair<TKey, TValue>>
Inherited Members
Namespace: TheXDS.MCART.Types
Assembly: MCART.dll
Syntax
public class AutoDictionary<TKey, TValue> : Dictionary<TKey, TValue>, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable, IDeserializationCallback, ISerializable where TKey : notnull where TValue : new()
Type Parameters
Name | Description |
---|---|
TKey | Key type to use. |
TValue | Type of value contained in this dictionary. |
Properties
| Edit this page View Sourcethis[TKey]
Gets or sets the value associated with the specified key, instantiating a new value if it does not exist.
Declaration
public TValue this[TKey key] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
TKey | key | Key of the value to get or set. A new value will be created if the key does not exist. |
Property Value
Type | Description |
---|---|
TValue | Value associated with the specified key. If the key is not found, a new element with that key will be created. |