BCL mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 System.Collections.IEnumerable System.Runtime.InteropServices.ComVisible(true)

The interface is the base interface for classes in the namespace.

The interface extends ; and are more specialized interfaces that extend . An implementation is a collection of key/value pairs, like the class. An implementation is a collection of values and its members can be accessed by index, like the class.

Some collections that limit access to their elements, such as the class and the class, directly implement the interface.

If neither the interface nor the interface meet the requirements of the required collection, derive the new collection class from the interface instead for more flexibility.

For the generic version of this interface, see .

Defines size, enumerators, and synchronization methods for all nongeneric collections.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` ``

  As described above.

  Use this method to copy from a collection to a .

  is . < 0.

  has more than one dimension.

  -or-

  is greater than or equal to .Length.

  -or-

  The sum of and the of the current instance is greater than .Length.

  At least one element in the current instance is not assignment-compatible with the type of .

  Copies the elements of the to an , starting at a particular index.

  The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. The zero-based index in at which copying begins. 0
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32

  A that indicates the number of elements contained in the current instance.

  This property is read-only.

  The property is required to return the total number of elements contained in the current instance.

  Gets the number of elements contained in the .

  0
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean

  if access to the current instance is synchronized (thread-safe); otherwise, .

  returns an object, which can be used to synchronize access to the .

  Most collection classes in the namespace also implement a Synchronized method, which provides a synchronized wrapper around the underlying collection.

  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.

  The following code example shows how to lock the collection using the property during the entire enumeration.

  code reference: System.Collections.ICollection#1

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

  0
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object

  A that can be used for thread-safe synchronized access to the current instance.

  For collections whose underlying store is not publicly available, the expected implementation is to return the current instance. Note that the pointer to the current instance might not be sufficient for collections that wrap other collections; those should return the underlying collection's SyncRoot property.

  Most collection classes in the namespace also implement a Synchronized method, which provides a synchronized wrapper around the underlying collection. However, derived classes can provide their own synchronized version of the collection using the property. The synchronizing code must perform operations on the property of the collection, not directly on the collection. 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 collection instance.

  In the absence of a Synchronized method on a collection, the expected usage for looks as follows:

  code reference: System.Collections.ICollection#2

  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.

  The following code example shows how to lock the collection using the property during the entire enumeration.

  code reference: System.Collections.ICollection#1

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

  0
0