System 2.0.0.0 4.0.0.0 System.Object System.Collections.IDictionary System.Collections.Specialized.IOrderedDictionary System.Runtime.Serialization.IDeserializationCallback System.Runtime.Serialization.ISerializable

Each element is a key/value pair stored in a object. A key cannot be null, but a value can be.

The elements of an are not sorted by the key, unlike the elements of a class. You can access elements either by the key or by the index.

The foreach statement of the C# language (For Each in Visual Basic) requires the type of each element in the collection. Since each element of the collection 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 . The following code shows C#, Visual Basic and C++ syntax.

code reference: System.Collections.Specialized.OrderedDictionary1#06

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

Represents a collection of key/value pairs that are accessible by the key or index.

- Constructor
  2.0.0.0
  4.0.0.0

  The comparer determines whether two keys are equal. Every key in a collection must be unique. The default comparer is the key's implementation of .

  Initializes a new instance of the class.

- Constructor
  2.0.0.0
  4.0.0.0

  The comparer determines whether two keys are equal. Every key in a collection must be unique. The default comparer is the key's implementation of .

  The custom comparer enables such scenarios as doing lookups with case-insensitive strings.

  Initializes a new instance of the class using the specified comparer.

  The to use to determine whether two keys are equal.
- Constructor
  2.0.0.0
  4.0.0.0

  The comparer determines whether two keys are equal. Every key in a collection must be unique. The default comparer is the key's implementation of .

  Initializes a new instance of the class using the specified initial capacity.

  The initial number of elements that the collection can contain.
- Constructor
  2.0.0.0
  4.0.0.0

  The comparer determines whether two keys are equal. Every key in a collection must be unique. The default comparer is the key's implementation of .

  The custom comparer enables such scenarios as doing lookups with case-insensitive strings.

  Initializes a new instance of the class using the specified initial capacity and comparer.

  The initial number of elements that the collection can contain.
  The to use to determine whether two keys are equal.
- Constructor
  2.0.0.0
  4.0.0.0

  The comparer determines whether two keys are equal. Every key in a collection must be unique. The default comparer is the key's implementation of .

  Initializes a new instance of the class that is serializable using the specified and objects.

  A object containing the information required to serialize the collection.
  A object containing the source and destination of the serialized stream associated with the .
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` ``

  A key cannot be null, but a value can be.

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

  Adds an entry with the specified key and value into the collection with the lowest available index.

  The key of the entry to add. The value of the entry to add. This value can be null.
- Method
  2.0.0.0
  4.0.0.0
  System.Collections.Specialized.OrderedDictionary

  The method creates a read-only wrapper around the current collection. Changes made to the collection are reflected in the read-only copy.

  Returns a read-only copy of the current collection.

  A read-only copy of the current collection.

- Method
  2.0.0.0
  4.0.0.0
  System.Void

  After calling the method, the property is set to zero and references to other objects from elements of the collection are also released. The capacity is not changed as a result of calling this method.

  Removes all elements from the collection.

- Method
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  Using the property can return a null value if the key does not exist or if the key is null. Use the method to determine if a specific key exists in the collection.

  Starting with the .NET Framework 2.0, this method uses the collection’s objects’ and methods on to determine whether exists. In the earlier versions of the .NET Framework, this determination was made by using the and methods of the parameter on the objects in the collection.

  Determines whether the collection contains a specific key.

  true if the collection contains an element with the specified key; otherwise, false.

  The key to locate in the collection.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` ``

  The method is not guaranteed to preserve the order of the elements in the collection.

  Copies the elements to a one-dimensional object at the specified index.

  The one-dimensional object that is the destination of the objects copied from collection. The must have zero-based indexing. The zero-based index in at which copying begins.
- Property
  2.0.0.0
  4.0.0.0
  System.Int32 To be added. To be added.

  Gets the number of key/values pairs contained in the collection.

- Method
  2.0.0.0
  4.0.0.0
  System.Collections.IDictionaryEnumerator

  [Visual Basic, C#]

  The foreach statement of the C# language (for each in Visual Basic) hides the complexity of the enumerators. Therefore, using foreach is recommended instead of directly manipulating the enumerator.

  Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.

  Initially, the enumerator is positioned before the first element in the collection.

  An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined.

  The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.

  This method is an O(1) operation.

  Returns an object that iterates through the collection.

  An object for the collection.

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

  Implements the interface and returns the data needed to serialize the collection.

  A object containing the information required to serialize the collection. A object containing the source and destination of the serialized stream associated with the .
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` `` ``

  If the parameter is equal to the number of entries in the collection, the and parameters are appended to the end of the collection.

  Entries that follow the insertion point move down to accommodate the new entry and the indexes of the moved entries are also updated.

  Inserts a new entry into the collection with the specified key and value at the specified index.

  The zero-based index at which the element should be inserted. The key of the entry to add. The value of the entry to add. The value can be null.
- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  A collection that is read-only does not allow the addition, removal, or modification of elements after the collection is created.

  A collection that is read-only is simply a collection with a wrapper that prevents modification of the collection; therefore, if changes are made to the underlying collection, the read-only collection reflects those changes.

  Gets a value indicating whether the collection is read-only.

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

  The returned object is not a static copy; instead, the refers back to the keys in the original collection. Therefore, changes to the continue to be reflected in the .

  Gets an object containing the keys in the collection.

- Method
  2.0.0.0
  4.0.0.0
  System.Void ``

  This method can be overridden.

  Implements the interface and is called back by the deserialization event when deserialization is complete.

  The source of the deserialization event.
- Method
  2.0.0.0
  4.0.0.0
  System.Void ``

  The entries that follow the removed entry move up to occupy the vacated spot and the indexes of the entries that move are also updated.

  If the collection does not contain an entry with the specified key, the remains unchanged and no exception is thrown.

  Removes the entry with the specified key from the collection.

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

  The entries that follow the removed entry move up to occupy the vacated spot and the indexes of the entries that move are also updated.

  Removes the entry at the specified index from the collection.

  The zero-based index of the entry to remove.
- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added. To be added.

  Gets a value indicating whether access to the object is synchronized (thread-safe).

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

  Gets an object that can be used to synchronize access to the object.

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

  Gets a value indicating whether the has a fixed size.

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

  Returns an object that iterates through the collection.

  An object for the collection.

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

  Implements the interface and is called back by the deserialization event when deserialization is complete.

  The source of the deserialization event.
- Property
  2.0.0.0
  4.0.0.0
  System.Collections.ICollection To be added.

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

  Gets an object containing the values in the collection.