Click or drag to resize
OrderedMultiDictionaryTKey, TValueView Class
The OrderedMultiDictionary<TKey,TValue>.View class is used to look at a subset of the keys and values inside an ordered multi-dictionary. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods.
Inheritance Hierarchy
SystemObject
  X3Platform.CollectionsCollectionBaseKeyValuePairTKey, ICollectionTValue
    X3Platform.CollectionsMultiDictionaryBaseTKey, TValue
      X3Platform.CollectionsOrderedMultiDictionaryTKey, TValueView

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
[SerializableAttribute]
public class View : MultiDictionaryBase<TKey, TValue>

The OrderedMultiDictionaryTKey, TValueView generic type exposes the following members.

Methods
  NameDescription
Public methodAdd(KeyValuePairTKey, ICollectionTValue)
Adds a key-value pair to the collection. The value part of the pair must be a collection of values to associate with the key. If values are already associated with the given key, the new values are added to the ones associated with that key.
(Inherited from MultiDictionaryBaseTKey, TValue.)
Public methodAdd(TKey, TValue)
Adds the given key-value pair to the underlying dictionary of this view. If key is not within the range of this view, an ArgumentException is thrown.
(Overrides MultiDictionaryBaseTKey, TValueAdd(TKey, TValue).)
Public methodAddMany

Adds new values to be associated with a key. If duplicate values are permitted, this method always adds new key-value pairs to the dictionary.

If duplicate values are not permitted, and key already has a value equal to one of values associated with it, then that value is replaced, and the number of values associate with key is unchanged.

(Inherited from MultiDictionaryBaseTKey, TValue.)
Public methodAsReadOnly
Provides a read-only view of this collection. The returned ICollection<T> provides a view of the collection that prevents modifications to the collection. Use the method to provide access to the collection without allowing changes. Since the returned object is just a view, changes to the collection will be reflected in the view.
(Inherited from CollectionBaseT.)
Public methodCode exampleClear
Removes all the keys and values within this view from the underlying OrderedMultiDictionary.
(Overrides MultiDictionaryBaseTKey, TValueClear.)
Public methodContains(KeyValuePairTKey, ICollectionTValue)
Determines if this dictionary contains the given key and all of the values associated with that key..
(Inherited from MultiDictionaryBaseTKey, TValue.)
Public methodContains(TKey, TValue)
Tests if the key-value pair is present in the part of the dictionary being viewed.
(Overrides MultiDictionaryBaseTKey, TValueContains(TKey, TValue).)
Public methodContainsKey
Tests if the key is present in the part of the dictionary being viewed.
(Overrides MultiDictionaryBaseTKey, TValueContainsKey(TKey).)
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 CollectionBaseT.)
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 CollectionBaseT.)
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.
(Inherited from MultiDictionaryBaseTKey, TValue.)
Protected methodCountValues
Gets the number of values associated with a given key.
(Overrides MultiDictionaryBaseTKey, TValueCountValues(TKey).)
Public methodCountWhere
Counts the number of items in the collection that satisfy the condition defined by predicate.
(Inherited from CollectionBaseT.)
Protected methodEnumerateKeys
Enumerate all the keys in the dictionary.
(Overrides MultiDictionaryBaseTKey, TValueEnumerateKeys.)
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.
(Inherited from MultiDictionaryBaseTKey, TValue.)
Public methodExists
Determines if the collection contains any item that satisfies the condition defined by predicate.
(Inherited from CollectionBaseT.)
Protected methodFinalize (Inherited from Object.)
Public methodFindAll
Enumerates the items in the collection that satisfy the condition defined by predicate.
(Inherited from CollectionBaseT.)
Public methodForEach
Performs the specified action on each item in this collection.
(Inherited from CollectionBaseT.)
Public methodGetEnumerator
Enumerate all the keys in the dictionary, and for each key, the collection of values for that key.
(Inherited from MultiDictionaryBaseTKey, TValue.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodRemove(KeyValuePairTKey, ICollectionTValue)
Removes a set of values from a given key. If all values associated with a key are removed, then the key is removed also.
(Inherited from MultiDictionaryBaseTKey, TValue.)
Public methodRemove(TKey)
Removes the key (and associated value) from the underlying dictionary of this view. If no key in the view is equal to the passed key, the dictionary and view are unchanged.
(Overrides MultiDictionaryBaseTKey, TValueRemove(TKey).)
Public methodRemove(TKey, TValue)
Removes the key and value from the underlying dictionary of this view. that is equal to the passed in key. If no key in the view is equal to the passed key, or has the given value associated with it, the dictionary and view are unchanged.
(Overrides MultiDictionaryBaseTKey, TValueRemove(TKey, TValue).)
Public methodRemoveAll
Removes all the items in the collection that satisfy the condition defined by predicate.
(Inherited from CollectionBaseT.)
Public methodRemoveMany(IEnumerableTKey)
Remove all of the keys (and any associated values) in a collection of keys. If a key is not present in the dictionary, nothing happens.
(Inherited from MultiDictionaryBaseTKey, TValue.)
Public methodRemoveMany(TKey, IEnumerableTValue)
Removes a collection of values from the values associated with a key. If the last value is removed from a key, the key is removed also.
(Inherited from MultiDictionaryBaseTKey, TValue.)
Public methodReplace
Replaces all values associated with key with the single value value.
(Inherited from MultiDictionaryBaseTKey, TValue.)
Public methodReplaceMany
Replaces all values associated with key with a new collection of values. If the collection does not permit duplicate values, and values has duplicate items, then only the last of duplicates is added.
(Inherited from MultiDictionaryBaseTKey, TValue.)
Public methodReversed
Creates a new View that has the same keys and values as this, in the reversed order.
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 CollectionBaseT.)
Public methodToString
Shows the string representation of the dictionary. The string representation contains a list of the mappings in the dictionary.
(Inherited from MultiDictionaryBaseTKey, TValue.)
Public methodTrueForAll
Determines if all of the items in the collection satisfy the condition defined by predicate.
(Inherited from CollectionBaseT.)
Protected methodTryEnumerateValuesForKey
Enumerate all of the values associated with a given key. 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.
(Overrides MultiDictionaryBaseTKey, TValueTryEnumerateValuesForKey(TKey, IEnumeratorTValue).)
Top
Properties
  NameDescription
Public propertyCount
Number of keys in this view.
(Overrides MultiDictionaryBaseTKey, TValueCount.)
Public propertyItem
Returns a collection of all of the values in the dictionary associated with key, or changes the set of values associated with key. If the key is not present in the dictionary, an ICollection enumerating no values is returned. The returned collection of values is read-write, and can be used to modify the collection of values associated with the key.
(Inherited from MultiDictionaryBaseTKey, TValue.)
Public propertyKeys
Gets a read-only collection all the keys in this dictionary.
(Inherited from MultiDictionaryBaseTKey, TValue.)
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.
(Inherited from MultiDictionaryBaseTKey, TValue.)
Public propertyValues
Gets a read-only collection of all the values in the dictionary.
(Inherited from MultiDictionaryBaseTKey, TValue.)
Top
Remarks

Views are dynamic. If the underlying dictionary changes, the view changes in sync. If a change is made to the view, the underlying dictionary changes accordingly.

Typically, this class is used in conjunction with a foreach statement to enumerate the keys and values in a subset of the OrderedMultiDictionary. For example:

foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, to)) {
   // process pair
}
See Also