CVB.Net 14.0
ReadOnlyDictionary< TKey, TValue > Class Template Reference

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...
 
- Public Member Functions inherited from ReadOnlyDictionaryBase< TKey, TValue >
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.
 
- Properties inherited from ReadOnlyDictionaryBase< TKey, TValue >
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

- Protected Member Functions inherited from ReadOnlyDictionaryBase< TKey, TValue >
 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...
 

Detailed Description

Read-only, generic collection of key/value pairs.

This class wraps another dictionary as a read-only view on it.

Template Parameters
TKeyType of keys in the dictionary.
TValueType of values in the dictionary.

Constructor & Destructor Documentation

◆ ReadOnlyDictionary()

ReadOnlyDictionary ( IDictionary< TKey, TValue >  dictionary)

Creates a new ReadOnlyDictionary wrapping the given dictionary .

Parameters
dictionaryDictionary to wrap.
Exceptions
ArgumentNullExceptiondictionary is null.