Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Class: RT.Util.Collections.AutoDictionary<TKey, TValue>

Summary

Implements a dictionary with an indexer which automatically inserts missing keys on reads. In all other ways it behaves exactly the same as a standard dictionary.

Generic type parameters

TKeyThis type parameter is not documented.
TValueThis type parameter is not documented.

Constructors

AutoDictionary<TKey, TValue>(Func<TKey, TValue> initializer = null)
Constructor.
AutoDictionary<TKey, TValue>(int capacity, Func<TKey, TValue> initializer = null)
AutoDictionary<TKey, TValue>(IEqualityComparer<TKey> comparer, Func<TKey, TValue> initializer = null)
AutoDictionary<TKey, TValue>(IDictionary<TKey, TValue> dictionary, Func<TKey, TValue> initializer = null)
AutoDictionary<TKey, TValue>(int capacity, IEqualityComparer<TKey> comparer, Func<TKey, TValue> initializer = null)
AutoDictionary<TKey, TValue>(IDictionary<TKey, TValue> dictionary, IEqualityComparer<TKey> comparer, Func<TKey, TValue> initializer = null)

Instance methods

void
Add(TKey key, TValue value)
  • Implements: IDictionary<TKey, TValue>.Add(TKey, TValue)
Equivalent to the same method in Dictionary<TKey, TValue>.
void
bool
ContainsKey(TKey key)
  • Implements: IDictionary<TKey, TValue>.ContainsKey(TKey)
bool
ContainsValue(TValue value)
Dictionary<TKey, TValue>.Enumerator
void
GetObjectData(SerializationInfo info, StreamingContext context)
  • Virtual
void
OnDeserialization(object sender)
  • Virtual
bool
Remove(TKey key)
  • Implements: IDictionary<TKey, TValue>.Remove(TKey)
bool
TryGetValue(TKey key, out TValue value)
  • Implements: IDictionary<TKey, TValue>.TryGetValue(TKey, out TValue)

Instance properties

IEqualityComparer<TKey>Equivalent to the same property in Dictionary<TKey, TValue>.
int
TValue
this[TKey key]
  • Implements: IDictionary<TKey, TValue>.this[TKey]
Gets or sets the element with the specified key. When getting a key that hasn't been set before, the key is added to the dictionary with a value returned by the initializer as configured in the constructor.
Dictionary<TKey, TValue>.KeyCollectionEquivalent to the same property in Dictionary<TKey, TValue>.
Dictionary<TKey, TValue>.ValueCollection