System [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00] 1.0.3300.0 1.0.5000.0 2.0.0.0 4.0.0.0 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.Object System.Collections.IDictionary

This class is recommended for cases where the number of elements in a dictionary is unknown. It takes advantage of the improved performance of a with small collections, and offers the flexibility of switching to a which handles larger collections better than .

If the initial size of the collection is greater than the optimal size for a , the collection is stored in a to avoid the overhead of copying elements from the to a .

The constructor accepts a Boolean parameter that allows the user to specify whether the collection ignores the case when comparing strings. If the collection is case-sensitive, it uses the key's implementations of and . If the collection is case-insensitive, it performs a simple ordinal case-insensitive comparison, which obeys the casing rules of the invariant culture only. By default, the collection is case-sensitive. For more information on the invariant culture, see .

A key cannot be null, but a value can.

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 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: System.Collections.Specialized.HybridDictionary2#2

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

Implements IDictionary by using a while the collection is small, and then switching to a when the collection gets large.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  By default, the collection is case-sensitive and uses the key's implementation of as the hash code provider and the key's implementation of as the comparer.

  The comparer determines whether two keys are equal. Every key in a must be unique.

  This constructor is an O(1) operation.

  Creates an empty case-sensitive .

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  If is false, the collection uses the key's implementations of and . If is true, the collection performs a simple ordinal case-insensitive comparison, which obeys the casing rules of the invariant culture only. For more information on the invariant culture, see .

  This constructor is an O(1) operation.

  Creates an empty with the specified case sensitivity.

  A Boolean that denotes whether the is case-insensitive.
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  If the initial size of the collection is greater than the optimal size for a , the collection is stored in a to avoid the overhead of copying elements from the to the .

  By default, the collection is case-sensitive and uses the key's implementation of as the hash code provider and the key's implementation of as the comparer.

  The comparer determines whether two keys are equal. Every key in a must be unique.

  This constructor is an O() operation, where is .

  Creates a case-sensitive with the specified initial size.

  The approximate number of entries that the can initially contain.
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  If the initial size of the collection is greater than the optimal size for a , the collection is stored in a to avoid the overhead of copying elements from the to the .

  If is false, the collection uses the key's implementations of and . If is true, the collection performs a simple ordinal case-insensitive comparison, which obeys the casing rules of the invariant culture only. For more information on the invariant culture, see .

  This constructor is an O() operation, where is .

  Creates a with the specified initial size and case sensitivity.

  The approximate number of entries that the can initially contain.
  A Boolean that denotes whether the is case-insensitive.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` ``

  An object that has no correlation between its state and its hash code value should typically not be used as the key. For example, String objects are better than StringBuilder objects for use as keys.

  A key cannot be null, but a value can.

  You can also use the property to add new elements by setting the value of a key that does not exist in the ; for example, myCollection["myNonexistentKey"] = myValue. 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.

  When the number of elements becomes greater than the optimal size for a , the elements are copied from the to a . However, this only happens once. If the collection is already stored in a and the number of elements falls below the optimal size for a , the collection remains in the .

  This method is an O(1) operation.

  Adds an entry with the specified key and value into the .

  The key of the entry to add. The value of the entry to add. The value can be null.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  is set to zero, and references to other objects from elements of the collection are also released.

  If the collection is already stored in a , the collection remains in the .

  This method is an O() operation, where is .

  Removes all entries from the .

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  This method is an O(1) operation.

  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 contains a specific key.

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

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

  The elements are copied to the in the same order in which the enumerator iterates through the .

  To copy only the keys in the , use HybridDictionary.Keys.CopyTo.

  To copy only the values in the , use HybridDictionary.Values.CopyTo.

  This method is an O() operation, where is .

  Copies the entries to a one-dimensional instance at the specified index.

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

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

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Collections.IDictionaryEnumerator

  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. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of .

  returns the same object until either or is called. sets to the next element.

  If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns false. When the enumerator is at this position, subsequent calls to also return false. If the last call to returned false, is undefined. To set to the first element of the collection again, you can call followed by .

  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 that iterates through the .

  An for the .

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added: an object of type 'bool'

  implements the property because it is required by the interface.

  A collection with a fixed size does not allow the addition or removal of elements after the collection is created, but it allows the modification of existing elements.

  A collection with a fixed size is simply a collection with a wrapper that prevents adding and removing elements; therefore, if changes are made to the underlying collection, including the addition or removal of elements, the fixed-size collection reflects those changes.

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

  Gets a value indicating whether the has a fixed size.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added: an object of type 'bool'

  implements the property because it is required by the interface.

  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 modifying the collection; therefore, if changes are made to the underlying collection, the read-only collection reflects those changes.

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

  Gets a value indicating whether the is read-only.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added: an object of type 'bool'

  implements the property because it is required by the interface.

  Derived classes can provide a synchronized version of the using the property.

  Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads.

  Gets a value indicating whether the is synchronized (thread safe).

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object `` To be added: an object of type 'object' To be added To be added: an object of type 'object' To be added
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Collections.ICollection To be added: an object of type 'Collections.ICollection'

  The order of the values in the is unspecified, but it is the same order as the associated values in the returned by the method.

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

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

  Gets an containing the keys in the .

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void ``

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

  If the collection is already stored in a and the number of elements falls below the optimal size for a , the collection remains in the to avoid the overhead of copying elements from the back to a .

  This method is an O(1) operation.

  Removes the entry with the specified key from the .

  The key of the entry to remove.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object To be added: an object of type 'object'

  Derived classes can provide their own synchronized version of the using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object.

  Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads.

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

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Collections.IEnumerator

  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. also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of .

  returns the same object until either or is called. sets to the next element.

  If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns false. When the enumerator is at this position, subsequent calls to also return false. If the last call to returned false, calling throws an exception. To set to the first element of the collection again, you can call followed by .

  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 the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated.

  The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads.

  This method is an O(1) operation.

  Returns an that iterates through the .

  An for the .

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Collections.ICollection To be added: an object of type 'Collections.ICollection'

  The order of the values in the is unspecified, but it is the same order as the associated keys in the returned by the method.

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

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

  Gets an containing the values in the .