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.Runtime.InteropServices.ComVisible(true) System.Runtime.InteropServices.Guid("496B0ABF-CDEE-11D3-88E8-00902754C43A")

Implemented by classes that support a simple iteration over a collection.

contains the and methods and the property. The consumer of an object should call these methods or use this property when iterating over or reading the elements of a collection.

When an enumerator is instantiated or a call is made to , the enumerator is positioned immediately before the first element of the collection and a snapshot of the collection is taken. When the enumerator is in this position, a call to is necessary before reading from the collection. If changes are made to the collection (such as adding, repositioning, or deleting elements) the snapshot can get out of sync, causing the enumerator to throw a if or are invoked. Two enumerators instantiated from the same collection at the same time can have different snapshots of the collection.

Enumerators are intended to be used only to read data in the collection.

An enumerator does not have exclusive access to the collection for which it was instantiated.

- Property
  System.Object

  Gets the element in the collection over which the current instance is positioned.

  The element in the collection over which the current instance is positioned.

  When the current instance is constructed or after is called, use to position the current instance over the first element of the collection.

  It is required that return the element in the collection over which the current instance is positioned unless it is positioned before the first or after the last element of the collection. If the current instance is positioned before the first element or after the last element of the collection, returns an unspecified value or throws an unspecified exception. If elements were added, removed, or repositioned in the collection after the current instance was instantiated, returns the value it would have returned before the collection was modified.

  It is also required that not change the position of the current instance: consecutive calls to are required to return the same object until either or is called.

  This property is read-only.

  Use to get the element in the collection over which the current instance is positioned, provided that the current instance is not positioned before the first element or after the last element of the collection.

  The current instance is positioned before the first element or after the last element of the collection.

  The collection was modified after the current instance was instantiated.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.Boolean

  Advances the current instance to the next element of the collection.

  if the current instance was successfully advanced to the next element; if the current instance has passed the end of the collection.

  When the current instance is constructed or after is called, the current instance is positioned immediately before the first element of the collection. Use to position it over the first element of the collection.

  A call to is required to position the current instance over the next element in the collection and return if the current instance was not positioned beyond the last element of the collection when was called. If the current instance is already positioned immediately after the last element of the collection, a call to is required to return , and the current instance is required to remain in the same position. If elements are added, removed, or repositioned in the collection after the current instance was instantiated, it is required that a call to throw .

  Use the method to check if the current instance is positioned immediately after the last element of the collection, and to position it over the next element if it is not already past the last element of the collection. This allows the use of a conditional loop to iterate over the entire collection.

  The collection was modified after the current instance was instantiated.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.Void

  Positions the enumerator immediately before the first element in the collection.

  When the current instance is constructed or after is called, the current instance is positioned immediately before the first element of the collection, use to position the current instance over the first element of the collection.

  A call to is required to position the current instance immediately before the first element of the collection. If elements are added, removed, or repositioned in the collection after the current instance was instantiated, it is required that a call to throw a .

  A call to can involve taking a new snapshot of the collection or simply moving to the beginning of the collection. The preferred implementation is to simply move the current instance to the beginning of the collection, before the first element. This invalidates the current instance if the collection has been modified since the current instance was constructed, which is consistent with and .

  Use the method to check if the current instance is positioned immediately past the last element of the collection, and to position it over the next element if it is not already past the last element of the collection.

  The collection was modified after the enumerator was instantiated. 0 1.0.5000.0 2.0.0.0 4.0.0.0
0