Click or drag to resize
ReadOnlyMultiDictionaryBaseTKey, TValue Class
MultiDictionaryBase is a base class that can be used to more easily implement a class that associates multiple values to a single key. The class implements the generic IDictionary<TKey, ICollection<TValue>> interface. The resulting collection is read-only -- items cannot be added or removed.
Inheritance Hierarchy
SystemObject
  X3Platform.CollectionsReadOnlyCollectionBaseKeyValuePairTKey, ICollectionTValue
    X3Platform.CollectionsReadOnlyMultiDictionaryBaseTKey, TValue

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
[SerializableAttribute]
public abstract class ReadOnlyMultiDictionaryBase<TKey, TValue> : ReadOnlyCollectionBase<KeyValuePair<TKey, ICollection<TValue>>>, 
	IDictionary<TKey, ICollection<TValue>>, ICollection<KeyValuePair<TKey, ICollection<TValue>>>, 
	IEnumerable<KeyValuePair<TKey, ICollection<TValue>>>, IEnumerable

Type Parameters

TKey
The key type of the dictionary.
TValue
The value type of the dictionary.

The ReadOnlyMultiDictionaryBaseTKey, TValue type exposes the following members.

Constructors
  NameDescription
Protected methodReadOnlyMultiDictionaryBaseTKey, TValue
Initializes a new instance of the ReadOnlyMultiDictionaryBaseTKey, TValue class
Top
Methods
  NameDescription
Public methodContains(KeyValuePairTKey, ICollectionTValue)
Determines if this dictionary contains the given key and all of the values associated with that key..
(Overrides ReadOnlyCollectionBaseTContains(T).)
Public methodContains(TKey, TValue)
Determines if this dictionary contains a key-value pair equal to key and value. The dictionary is not changed. This method must be overridden in the derived class.
Public methodContainsKey
Determines whether a given key is found in the dictionary.
Public methodConvertAllTOutput
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.
(Inherited from ReadOnlyCollectionBaseT.)
Public methodCopyTo
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.
(Inherited from ReadOnlyCollectionBaseT.)
Protected methodCountAllValues
Gets a total count of values in the collection. This default implementation is slow; it enumerates all of the keys in the dictionary and calls CountValues on each. A derived class may be able to supply a more efficient implementation.
Protected methodCountValues
Gets a count of the number of values associated with a key. The default implementation is slow; it enumerators all of the values (using TryEnumerateValuesForKey) to count them. A derived class may be able to supply a more efficient implementation.
Public methodCountWhere
Counts the number of items in the collection that satisfy the condition defined by predicate.
(Inherited from ReadOnlyCollectionBaseT.)
Protected methodEnumerateKeys
Enumerate all the keys in the dictionary. This method must be overridden by a derived class.
Public methodEquals (Inherited from Object.)
Protected methodEqualValues
If the derived class does not use the default comparison for values, this methods should be overridden to compare two values for equality. This is used for the correct implementation of ICollection.Contains on the Values and KeyValuePairs collections.
Public methodExists
Determines if the collection contains any item that satisfies the condition defined by predicate.
(Inherited from ReadOnlyCollectionBaseT.)
Protected methodFinalize (Inherited from Object.)
Public methodFindAll
Enumerates the items in the collection that satisfy the condition defined by predicate.
(Inherited from ReadOnlyCollectionBaseT.)
Public methodForEach
Performs the specified action on each item in this collection.
(Inherited from ReadOnlyCollectionBaseT.)
Public methodGetEnumerator
Enumerate all the keys in the dictionary, and for each key, the collection of values for that key.
(Overrides ReadOnlyCollectionBaseTGetEnumerator.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToArray
Creates an array of the correct size, and copies all the items in the collection into the array, by calling CopyTo.
(Inherited from ReadOnlyCollectionBaseT.)
Public methodToString
Shows the string representation of the dictionary. The string representation contains a list of the mappings in the dictionary.
(Overrides ReadOnlyCollectionBaseTToString.)
Public methodTrueForAll
Determines if all of the items in the collection satisfy the condition defined by predicate.
(Inherited from ReadOnlyCollectionBaseT.)
Protected methodTryEnumerateValuesForKey
Enumerate all of the values associated with a given key. This method must be overridden by the derived class. If the key exists and has values associated with it, an enumerator for those values is returned throught values. If the key does not exist, false is returned.
Top
Properties
  NameDescription
Public propertyCount
Gets the number of keys in the dictionary. This property must be overridden in the derived class.
(Overrides ReadOnlyCollectionBaseTCount.)
Public propertyItem
Returns a collection of all of the values in the dictionary associated with key. If the key is not present in the dictionary, an ICollection with no values is returned. The returned ICollection is read-only.
Public propertyKeys
Gets a read-only collection all the keys in this dictionary.
Public propertyKeyValuePairs
Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple values associated with it, then a key-value pair is present for each value associated with the key.
Public propertyValues
Gets a read-only collection of all the values in the dictionary.
Top
Remarks

To use ReadOnlyMultiDictionaryBase as a base class, the derived class must override Count, Contains(TKey,TValue), EnumerateKeys, and TryEnumerateValuesForKey .

See Also