ReadOnlyDictionaryAdapter class
Adapts a non-generic IDictionary to a read-only dictionary with string keys and nullable object values.
public sealed class ReadOnlyDictionaryAdapter : IReadOnlyDictionary<string, object>
parameter | description |
inner | The non-generic IDictionary to adapt. |
Public Members
name | description |
ReadOnlyDictionaryAdapter(…) | Adapts a non-generic IDictionary to a read-only dictionary with string keys and nullable object values. |
Count { get; } | Gets the number of key/value pairs contained in the adapted dictionary. |
Item { get; } | Gets the value associated with the specified string key, or null if the key does not exist. |
Keys { get; } | Gets an enumerable collection of the string keys in the adapted dictionary. |
Values { get; } | Gets an enumerable collection of the values in the adapted dictionary. |
ContainsKey(…) | Determines whether the adapted dictionary contains an element with the specified string key. |
GetEnumerator() | Returns an enumerator that iterates through the key/value pairs in the adapted dictionary. |
TryGetValue(…) | Attempts to get the value associated with the specified string key. |
Exceptions
exception | condition |
ArgumentNullException | Thrown when inner is null. |
Initializes a new instance of the ReadOnlyDictionaryAdapter
class with the specified non-generic dictionary.
See Also