| Variables: |
|---|
public System.Object Current |
| Constructors: |
|---|
| Functions: |
|---|
public System.Boolean MoveNext() Advances the current instance to the next element of the collection. Returns: true if the current instance was successfully advanced to the next element; false if the current instance has passed the end of the collection. Throws: : The collection was modified after the current instance was instantiated. When the current instance is constructed or after System.Collections.IEnumerator.Reset is called, the current instance is positioned immediately before the first element of the collection. Use System.Collections.IEnumerator.MoveNext to position it over the first element of the collection. A call to System.Collections.IEnumerator.MoveNext is required to position the current instance over the next element in the collection and return true if the current instance was not positioned beyond the last element of the collection when System.Collections.IEnumerator.MoveNext was called. If the current instance is already positioned immediately after the last element of the collection, a call to System.Collections.IEnumerator.MoveNext is required to return false, 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 System.Collections.IEnumerator.MoveNext throw System.InvalidOperationException. Use the System.Collections.IEnumerator.MoveNext 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. |
public System.Void Reset() Positions the enumerator immediately before the first element in the collection. Throws: : The collection was modified after the enumerator was instantiated. When the current instance is constructed or after System.Collections.IEnumerator.Reset is called, the current instance is positioned immediately before the first element of the collection, use System.Collections.IEnumerator.MoveNext to position the current instance over the first element of the collection. A call to System.Collections.IEnumerator.Reset 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 System.Collections.IEnumerator.Reset throw a System.InvalidOperationException. A call to System.Collections.IEnumerator.Reset 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 System.Collections.IEnumerator.MoveNext and System.Collections.IEnumerator.Current. Use the System.Collections.IEnumerator.MoveNext 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. |