ReadOnlyDictionary<TKey,TValue>
Class
Definition
Represents a read-only, generic collection of key/value pairs.
public class ReadOnlyDictionary<TKey,TValue> : System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>, System.Collections.Generic.IDictionary<TKey,TValue>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>>, System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>, System.Collections.Generic.IReadOnlyDictionary<TKey,TValue>, System.Collections.IDictionary
- TKey
The type of keys in the dictionary.
- TValue
The type of values in the dictionary.
- Inheritance
-
ReadOnlyDictionary<TKey,TValue>
- Implements
-
ICollection<KeyValuePair<TKey,TValue>> IDictionary<TKey,TValue> IEnumerable<KeyValuePair<TKey,TValue>> IReadOnlyCollection<KeyValuePair<TKey,TValue>> IReadOnlyDictionary<TKey,TValue> IDictionary
Inherited Members
System.Object
Constructors
| ReadOnlyDictionary<TKey,TValue>(IDictionary<TKey,TValue>) |
Initializes a new instance of the ReadOnlyDictionary<TKey,TValue> class that is a wrapper around the specified dictionary. |
Properties
| Count |
Gets the number of items in the dictionary. |
| Dictionary |
Gets the dictionary that is wrapped by this ReadOnlyDictionary<TKey,TValue> object. |
| Item[TKey] |
Gets the element that has the specified key. |
| Keys |
Gets a key collection that contains the keys of the dictionary. |
| Values |
Gets a collection that contains the values in the dictionary. |
Methods
| ContainsKey(TKey) |
Determines whether the dictionary contains an element that has the specified key. |
| GetEnumerator() |
Returns an enumerator that iterates through the ReadOnlyDictionary<TKey,TValue>. |
| TryGetValue(TKey, TValue) |
Retrieves the value that is associated with the specified key. |