mscorlib 2.0.0.0 4.0.0.0 System.Object System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>> System.Collections.Generic.IDictionary<TKey,TValue> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<TKey,TValue>> System.Collections.Generic.IReadOnlyDictionary<TKey,TValue> System.Collections.IDictionary System.Runtime.Serialization.IDeserializationCallback System.Runtime.Serialization.ISerializable System.Diagnostics.DebuggerDisplay("Count={Count}") System.Diagnostics.DebuggerTypeProxy(typeof(System.Collections.Generic.CollectionDebuggerView`2)) System.Runtime.InteropServices.ComVisible(false) To be added. To be added.

Represents a collection of key/value pairs that are organized based on the key.

Each element is a key/value pair that can be retrieved as a object.

requires an equality comparer implementation to perform comparisons. If no equality comparer is provided, the following default equality comparer approach is used: If type implements , that implementation is used; otherwise, 's implementations of and are used. In any case, you can specify a implementation in a constructor overload that accepts an equality comparer parameter.

After its insertion in a dictionary, changes to the value of a key that affect the equality comparer render the dictionary's behavior unspecified. Every key in a dictionary must be unique according to the equality comparer. A key cannot be , but a value can be, if the value type is a reference type.

The capacity of a dictionary is the number of elements that dictionary can hold. As elements are added to a dictionary, the capacity is automatically increased.

This type contains a member that is a nested type, called . Although is a member of this type, is not described here; instead, it is described in its own entry, .

- Constructor
  2.0.0.0
  4.0.0.0

  Initializes a new dictionary that is empty, has the default initial capacity, and uses the default equality comparer.

  To be added.
- Constructor
  2.0.0.0
  4.0.0.0

  The dictionary whose elements are to be copied to the new dictionary.

  Initializes a new dictionary that contains elements copied from the specified dictionary, has sufficient capacity to accommodate the number of elements copied, and uses the default equality comparer.

  Every key in a dictionary must be unique according to the default equality comparer; otherwise, a is thrown; likewise, every key in the source dictionary must also be unique according to the default equality comparer.

  contains one or more duplicate keys.

  is .

- Constructor
  2.0.0.0
  4.0.0.0

  The equality comparer implementation to use when comparing keys.

  -or-

  to use the default equality comparer for the type of the key.

  Initializes a new dictionary that is empty, has the default initial capacity, and uses the specified equality comparer.

  To be added.
- Constructor
  2.0.0.0
  4.0.0.0
  The initial number of elements that the dictionary can contain.

  Initializes a new dictionary that is empty, has the specified initial capacity, and uses the default equality comparer.

  To be added.
  is less than zero.
- Constructor
  2.0.0.0
  4.0.0.0

  The dictionary whose elements are to be copied to the new dictionary.

  The equality comparer implementation to use when comparing keys.

  -or-

  to use the default equality comparer for the type of the key.

  Initializes a new dictionary that contains elements copied from the specified dictionary, has sufficient capacity to accommodate the number of elements copied, and uses the specified equality comparer.

  Every key in a dictionary must be unique according to the specified; otherwise, a is thrown; likewise, every key in the source dictionary must also be unique according to the specified equality comparer.

  contains one or more duplicate keys.

  is .

- Constructor
  2.0.0.0
  4.0.0.0

  The initial number of elements that the dictionary can contain.

  The equality comparer implementation to use when comparing keys.

  -or-

  to use the default equality comparer for the type of the key.

  Initializes a new dictionary that is empty, has the specified initial capacity, and uses the specified equality comparer.

  To be added.
  is less than zero.
- Constructor
  2.0.0.0
  4.0.0.0
  To be added.
  To be added.
  To be added.
  To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` `` The key of the element to add to the dictionary. The value of the element to add to the dictionary.

  Adds an element with the specified key and value to the dictionary.

  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.

  If already equals the capacity, the capacity of the dictionary is increased.

  A key cannot be , but a value can be, if the value type TValue is a reference type.

  An element with the same key already exists in the dictionary.

  is .

- Method
  2.0.0.0
  4.0.0.0
  System.Void

  Removes all elements from the dictionary.

  This method is implemented to support the interface.

  gets set to zero, and references to other objects from elements of the collection are also released. The capacity remains unchanged.

- Property
  2.0.0.0
  4.0.0.0
  System.Collections.Generic.IEqualityComparer<TKey> To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` The key to locate in the dictionary.

  Determines whether the dictionary contains an element with a specific key.

  , if an element whose key is is found in the dictionary; otherwise, .

  This implementation is close to O(1) in most cases.

  is .

- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` The value to locate in the dictionary.

  Determines whether the dictionary contains an element with a specific value.

  , if an element whose value is is found in the dictionary; otherwise, .

  This method determines equality using the default equality comparer for the value type TValue. If TValue implements , that type is used. Otherwise, is used.

  This method performs a linear search; therefore, the average execution time is proportional to . That is, this method is an O(n) operation, where n is .

- Property
  2.0.0.0
  4.0.0.0
  System.Int32

  Gets the number of key/value pairs contained in the dictionary.

  The number of key/value pairs contained in the dictionary.

  This property is read-only.

  Retrieving the value of this property is an O(1) operation.

- Method
  2.0.0.0
  4.0.0.0
  System.Collections.Generic.Dictionary<TKey,TValue>+Enumerator

  Returns an enumerator that can be used to iterate over the dictionary.

  An enumerator for the dictionary.

  For a detailed description regarding the use of an enumerator, see .

- Method
  2.0.0.0
  4.0.0.0
  System.Void `` `` To be added. To be added. To be added. To be added.
- Property
  2.0.0.0
  4.0.0.0
  TValue `` The key whose value is to be gotten or set.

  Gets or sets the value associated with the specified key.

  The value associated with the specified key. On a get attempt, if the specified key is not found, a is thrown. On a set attempt, if the specified key is not found, a new element using the specified key is created.

  The default value for value types is zero while that for reference types is .

  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.

  A key cannot be , but a value can be, if the value type TValue is a reference type.

  Retrieving the value of this property is an O(1) operation; setting the property is also an O(1) operation.

  is .

  During a get attempt, is not found in the dictionary.

- Property
  2.0.0.0
  4.0.0.0
  System.Collections.Generic.Dictionary<TKey,TValue>+KeyCollection

  Gets a collection that contains the keys in the dictionary.

  A collection of the keys in the dictionary.

  This property is read-only.

  The order of the keys in the key collection is unspecified, but it is the same order as the associated values in the value collection returned by the property.

  If the dictionary is modified, or the value of any key in the dictionary is modified, the behavior of the key collection is unspecified.

- Method
  2.0.0.0
  4.0.0.0
  System.Void `` To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` The key of the element to be removed from the dictionary.

  Removes the element with the specified key from the dictionary.

  if the element containing is successfully removed; otherwise, . This method also returns if was not found in the dictionary.

  If the dictionary does not contain an element with the specified key, the dictionary remains unchanged. No exception is thrown.

  This method shall be implemented with efficiency that is at least an O(1) operation.

  is .

- Method
  2.0.0.0
  4.0.0.0
  System.Void `` To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` `` To be added. To be added.

  This method is implemented to support the interface.

  To be added.
- Property
  2.0.0.0
  4.0.0.0
  System.Boolean

  This read-only property is implemented to support the interface.

  To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` 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<TKey>

  This read-only property is implemented to support the interface.

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

  This read-only property is implemented to support the interface.

  To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey,TValue>>

  This method is implemented to support the interface.

  To be added. To be added.
- Property
  4.0.0.0
  System.Collections.Generic.IEnumerable<TKey> To be added. To be added. To be added.
- Property
  4.0.0.0
  System.Collections.Generic.IEnumerable<TValue> To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` `` To be added. To be added.

  This method is implemented to support the interface.

  To be added.
- Property
  2.0.0.0
  4.0.0.0
  System.Boolean

  This read-only property is implemented to support the interface.

  To be added. To be added.
- Property
  2.0.0.0
  4.0.0.0
  System.Object

  This read-only property is implemented to support the interface.

  To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` `` To be added. To be added.

  This method is implemented to support the interface.

  To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` To be added.

  This method is implemented to support the interface.

  To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Collections.IDictionaryEnumerator

  This method is implemented to support the interface.

  To be added. To be added.
- Property
  2.0.0.0
  4.0.0.0
  System.Boolean

  This read-only property is implemented to support the interface.

  To be added. To be added.
- Property
  2.0.0.0
  4.0.0.0
  System.Boolean

  This read-only property is implemented to support the interface.

  To be added. To be added.
- Property
  2.0.0.0
  4.0.0.0
  System.Object `` To be added.

  This read-only property is implemented to support the interface.

  To be added. To be added.
- Property
  2.0.0.0
  4.0.0.0
  System.Collections.ICollection

  This read-only property is implemented to support the interface.

  To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` To be added.

  This method is implemented to support the interface.

  To be added.
- Property
  2.0.0.0
  4.0.0.0
  System.Collections.ICollection

  This read-only property is implemented to support the interface.

  To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Collections.IEnumerator

  This method is implemented to support the interface.

  To be added. To be added.
- 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.Dictionary<TKey,TValue>+ValueCollection

  Gets a collection that contains the values in the dictionary.

  A collection of the values in the dictionary.

  This property is read-only.

  The order of the values in the value collection is unspecified, but it is the same order as the associated values in the key collection returned by the property.

  The returned value collection is not a static copy; instead, it refers back to the values in the original dictionary. Therefore, changes to the dictionary continue to be reflected in the value collection.