mscorlib 2.0.0.0 4.0.0.0 System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> To be added. To be added.

The interface is the base interface for generic collections of key/value pairs.

Each element is a key/value pair stored in a object.

Each pair must have a unique key. Implementations can vary in whether they allow to be null. The value can be null and does not have to be unique. The interface allows the contained keys and values to be enumerated, but it does not imply any particular sort order.

The foreach statement of the C# language (For Each in Visual Basic, for each in C++) requires the type of each element in the collection. Since each element of the is a key/value pair, the element type is not the type of the key or the type of the value. Instead, the element type is . For example:

code reference: Generic.IDictionary#11

The foreach statement is a wrapper around the enumerator, which only allows reading from, not writing to, the collection.

Because keys can be inherited and their behavior changed, their absolute uniqueness cannot be guaranteed by comparisons using the method.

Represents a generic collection of key/value pairs.

- Method
  2.0.0.0
  4.0.0.0
  System.Void `` `` The to use as the key of the entry to add. The to use as the value of the entry to add.

  Adds an entry with the provided key and value to the current instance.

  You can also use the property to add new elements by setting the value of a key that does not exist in the dictionary. However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method does not modify existing elements.

  Implementations can vary in how they determine equality of objects.

  An entry with the same key already exists in the current instance.

  The current instance is read-only.

- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` The key to locate in the current instance.

  Determines whether the current instance contains an entry with the specified key.

  if the current instance contains an entry with the key; otherwise, .

  Implementations can vary in how they determine equality of objects.

- Property
  2.0.0.0
  4.0.0.0
  TValue `` The key of the element to get or set.

  Gets or sets the element in the current instance that is associated with the specified key.

  The value associated with the given key.

  This property provides the ability to access a specific element in the collection.

  You can also use the property to add new elements by setting the value of a key that does not exist in the dictionary. However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method does not modify existing elements.

  Implementations can vary in how they determine equality of objects.

  The property is read but is not found.

  The property is set and the current instance is read-only.

- Property
  2.0.0.0
  4.0.0.0
  System.Collections.Generic.ICollection<TKey>

  A collection containing the keys of the current instance.

  The order of the keys in the returned is unspecified, but it is guaranteed to be the same order as the corresponding values in the returned by the property.

  Gets an containing the keys of the .

- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` The key of the entry to remove.

  Removes the entry with the specified key from the current instance.

  if the element is successfully removed; otherwise, .

  This method also returns if was not found.

  Implementations can vary in how they determine equality of objects.

  The current instance is read-only.

- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` `` To be added. To be added. To be added. To be added. To be added.
- Property
  2.0.0.0
  4.0.0.0
  System.Collections.Generic.ICollection<TValue>

  A collection containing the values in the current instance.

  The order of the values in the returned is unspecified, but it is guaranteed to be the same order as the corresponding keys in the returned by the property.

  Gets an containing the values in the .