Read-only, generic collection of key/value pairs. More...
Inherits ReadOnlyDictionaryBase< TKey, TValue >.
Public Member Functions | |
ReadOnlyDictionary (IDictionary< TKey, TValue > dictionary) | |
Creates a new ReadOnlyDictionary wrapping the given dictionary . More... | |
![]() | |
virtual bool | ContainsKey (TKey key) |
Determines whether the key is in this collection. More... | |
virtual bool | TryGetValue (TKey key, out TValue value) |
Retrieves the value that is associated with the specific key . More... | |
Properties | |
new IDictionary< TKey, TValue > | Dictionary [get] |
Gets the wrapped dictionary. | |
![]() | |
IDictionary< TKey, TValue > | Dictionary [get] |
Gets the wrapped dictionary. | |
virtual TValue | this[TKey key] [get] |
Gets the element that has the specified key . More... | |
int | Count [get] |
Gets the number of items in the dictionary. | |
virtual ICollection< TKey > | Keys [get] |
Gets a read-only collection of all keys in this dictionary. | |
virtual ICollection< TValue > | Values [get] |
Gets a read-only collection of all values in this dictionary. | |
Additional Inherited Members | |
![]() | |
ReadOnlyDictionaryBase (IDictionary< TKey, TValue > dictionary) | |
Creates a new ReadOnlyDictionary wrapping the given dictionary . More... | |
virtual bool | Contains (KeyValuePair< TKey, TValue > item) |
Determines whether the item is in this collection. More... | |
virtual void | CopyTo (KeyValuePair< TKey, TValue >[] array, int arrayIndex) |
Copies the entire collection to a compatible one-dimensional array , starting at the specified arrayIndex . More... | |
virtual IEnumerator< KeyValuePair< TKey, TValue > > | GetEnumerator () |
Returns an enumerator that iterates through this collection. More... | |
Read-only, generic collection of key/value pairs.
This class wraps another dictionary as a read-only view on it.
TKey | Type of keys in the dictionary. |
TValue | Type of values in the dictionary. |
ReadOnlyDictionary | ( | IDictionary< TKey, TValue > | dictionary | ) |
Creates a new ReadOnlyDictionary wrapping the given dictionary .
dictionary | Dictionary to wrap. |
ArgumentNullException | dictionary is null . |