Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Sealed class: RT.Util.Collections.ReadOnlyDictionary<TKey, TValue>

Summary

Wraps an IDictionary<TKey, TValue> to allow reading values but prevent setting/removing them.

Generic type parameters

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

Constructors

ReadOnlyDictionary<TKey, TValue>(IDictionary<TKey, TValue> dict)
Creates a new read-only wrapper for the specified IDictionary<TKey, TValue>.

Instance methods

void
Add(KeyValuePair<TKey, TValue> item)
  • Implements: ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue>)
Not supported on a ReadOnlyDictionary.
void
Add(TKey key, TValue value)
  • Implements: IDictionary<TKey, TValue>.Add(TKey, TValue)
void
  • Implements: ICollection<KeyValuePair<TKey, TValue>>.Clear()
bool
Contains(KeyValuePair<TKey, TValue> item)
  • Implements: ICollection<KeyValuePair<TKey, TValue>>.Contains(KeyValuePair<TKey, TValue>)
Returns true if the dictionary contains the specified key/value pair.
bool
ContainsKey(TKey key)
  • Implements: IDictionary<TKey, TValue>.ContainsKey(TKey)
Returns true if the dictionary contains the specified key.
void
CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
  • Implements: ICollection<KeyValuePair<TKey, TValue>>.CopyTo(KeyValuePair<TKey, TValue>[], int)
Copies the key/value pairs of this dictionary into the specified array.
IEnumerator<KeyValuePair<TKey, TValue>>
  • Implements: IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator()
Gets an enumerator for the key/value pairs stored in this dictionary.
bool
IsWrapperFor(IDictionary<TKey, TValue> dict)
Returns true if dict is the same dictionary object as the one this class wraps.
bool
Remove(TKey key)
  • Implements: IDictionary<TKey, TValue>.Remove(TKey)
Not supported on a ReadOnlyDictionary.
bool
Remove(KeyValuePair<TKey, TValue> item)
  • Implements: ICollection<KeyValuePair<TKey, TValue>>.Remove(KeyValuePair<TKey, TValue>)
bool
TryGetValue(TKey key, out TValue value)
  • Implements: IDictionary<TKey, TValue>.TryGetValue(TKey, out TValue)
Gets the value associated with the specified key. Returns true if the value exists, false otherwise.

Instance properties

int
  • Implements: ICollection<KeyValuePair<TKey, TValue>>.Count
Gets the number of elements in this read-only collection.
bool
  • Implements: ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly
Returns true, as this is a read-only collection.
TValue
this[TKey key]
  • Implements: IDictionary<TKey, TValue>.this[TKey]
Gets a value from the dictionary. Setting values is not supported on a ReadOnlyDictionary.
ICollection<TKey>
  • Implements: IDictionary<TKey, TValue>.Keys
Gets a read-only collection of keys in this dictionary.
ICollection<TValue>
  • Implements: IDictionary<TKey, TValue>.Values
Gets a read-only collection of values in this dictionary.