Base class for read-only, generic collection of key/value pairs.
More...
Inherited by ReadOnlyDictionary< TKey, TValue >, NodeMapDictionary, NotifyDictionary, and NodeMap.
|
| virtual bool | ContainsKey (TKey key) |
| | Determines whether the key is in this collection.
|
| |
| virtual bool | TryGetValue (TKey key, out TValue value) |
| | Retrieves the value that is associated with the specific key .
|
| |
|
| | ReadOnlyDictionaryBase (IDictionary< TKey, TValue > dictionary) |
| | Creates a new ReadOnlyDictionary wrapping the given dictionary .
|
| |
| virtual bool | Contains (KeyValuePair< TKey, TValue > item) |
| | Determines whether the item is in this collection.
|
| |
| virtual void | CopyTo (KeyValuePair< TKey, TValue >[] array, int arrayIndex) |
| | Copies the entire collection to a compatible one-dimensional array , starting at the specified arrayIndex .
|
| |
| virtual IEnumerator< KeyValuePair< TKey, TValue > > | GetEnumerator () |
| | Returns an enumerator that iterates through this collection.
|
| |
|
|
IDictionary< TKey, TValue > | Dictionary [get] |
| | Gets the wrapped dictionary.
|
| |
| virtual TValue | this[TKey key] [get] |
| | Gets the element that has the specified key .
|
| |
|
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.
|
| |
Base class for read-only, generic collection of key/value pairs.
This class wraps another dictionary as a read-only view on it.
- Template Parameters
-
| TKey | Type of keys in the dictionary. |
| TValue | Type of values in the dictionary. |
◆ Contains()
| virtual bool Contains |
( |
KeyValuePair< TKey, TValue > | item | ) |
|
|
protectedvirtual |
Determines whether the item is in this collection.
- Parameters
-
| item | Key/value pair to locate. |
- Returns
- true if item could be located; false if not.
◆ ContainsKey()
| virtual bool ContainsKey |
( |
TKey | key | ) |
|
|
virtual |
Determines whether the key is in this collection.
- Parameters
-
| key | Key of element to locate. |
- Returns
- true if key could be located; false if not.
◆ CopyTo()
| virtual void CopyTo |
( |
KeyValuePair< TKey, TValue >[] | array, |
|
|
int | arrayIndex ) |
|
protectedvirtual |
Copies the entire collection to a compatible one-dimensional array , starting at the specified arrayIndex .
- Parameters
-
| array | Destination array. |
| arrayIndex | Zero-based index at which copying begins. |
- Exceptions
-
| ArgumentNullException | array is null. |
| ArgumentOutOfRangeException | arrayIndex is less than zero. |
| ArgumentException | The number of elements in this collection is greater than the available space in array . |
◆ GetEnumerator()
| virtual IEnumerator< KeyValuePair< TKey, TValue > > GetEnumerator |
( |
| ) |
|
|
protectedvirtual |
Returns an enumerator that iterates through this collection.
- Returns
- Enumerator object.
Reimplemented in NodeMapDictionary, and NodeMap.
◆ ReadOnlyDictionaryBase()
| ReadOnlyDictionaryBase |
( |
IDictionary< TKey, TValue > | dictionary | ) |
|
|
protected |
Creates a new ReadOnlyDictionary wrapping the given dictionary .
- Parameters
-
| dictionary | Dictionary to wrap. |
- Exceptions
-
| ArgumentNullException | dictionary is null. |
◆ TryGetValue()
| virtual bool TryGetValue |
( |
TKey | key, |
|
|
out TValue | value ) |
|
virtual |
Retrieves the value that is associated with the specific key .
- Parameters
-
| key | Key whose value will be retrieved. |
| value | Variable to be assigned with the object of the specified key , if the key is found. Otherwise the default value of TValue is assigned. |
- Returns
- true if this collection contains the specified key ; false otherwise.
◆ this[TKey key]
| virtual TValue this[TKey key] |
|
get |
Gets the element that has the specified key .
- Parameters
-
| key | Key of element to get. |
- Returns
- Element that has the specified key .
- Exceptions
-
| ArgumentNullException | key is null. |
| KeyNotFoundException | key is not found. |