ReadOnlyDictionaryBase is a base class that can be used to more easily implement the generic IDictionary<T> and non-generic IDictionary interfaces.
More...
|
virtual bool | Remove (TKey key) |
| Removes a key from the dictionary. Always throws an exception indicating that this method is not supported in a read-only dictionary. More...
|
|
virtual bool | ContainsKey (TKey key) |
| Determines whether a given key is found in the dictionary. More...
|
|
abstract bool | TryGetValue (TKey key, out TValue value) |
| Determines if this dictionary contains a key equal to key . If so, the value associated with that key is returned through the value parameter. This method must be overridden in the derived class. More...
|
|
override string | ToString () |
| Shows the string representation of the dictionary. The string representation contains a list of the mappings in the dictionary. More...
|
|
override bool | Contains (KeyValuePair< TKey, TValue > item) |
| Determines if a dictionary contains a given KeyValuePair. This implementation checks to see if the dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) the value. More...
|
|
override string | ToString () |
| Shows the string representation of the collection. The string representation contains a list of the items in the collection. More...
|
|
virtual bool | Exists (Predicate< T > predicate) |
| Determines if the collection contains any item that satisfies the condition defined by predicate . More...
|
|
virtual bool | TrueForAll (Predicate< T > predicate) |
| Determines if all of the items in the collection satisfy the condition defined by predicate . More...
|
|
virtual int | CountWhere (Predicate< T > predicate) |
| Counts the number of items in the collection that satisfy the condition defined by predicate . More...
|
|
IEnumerable< T > | FindAll (Predicate< T > predicate) |
| Enumerates the items in the collection that satisfy the condition defined by predicate . More...
|
|
virtual void | ForEach (Action< T > action) |
| Performs the specified action on each item in this collection. More...
|
|
virtual IEnumerable< TOutput > | ConvertAll< TOutput > (Converter< T, TOutput > converter) |
| Convert this collection of items by applying a delegate to each item in the collection. The resulting enumeration contains the result of applying converter to each item in this collection, in order. More...
|
|
virtual bool | Contains (T item) |
| Determines if the collection contains a particular item. This default implementation iterates all of the items in the collection via GetEnumerator, testing each item against item using IComparable<T>.Equals or Object.Equals. More...
|
|
virtual void | CopyTo (T[] array, int arrayIndex) |
| Copies all the items in the collection into an array. Implemented by using the enumerator returned from GetEnumerator to get all the items and copy them to the provided array. More...
|
|
virtual T[] | ToArray () |
| Creates an array of the correct size, and copies all the items in the collection into the array, by calling CopyTo. More...
|
|
ReadOnlyDictionaryBase is a base class that can be used to more easily implement the generic IDictionary<T> and non-generic IDictionary interfaces.
To use ReadOnlyDictionaryBase as a base class, the derived class must override Count, TryGetValue, GetEnumerator.
- Template Parameters
-
TKey | The key type of the dictionary. |
TValue | The value type of the dictionary. |