System.Collections.IEnumerator.Reset Method

Sets the enumerator to its initial position, which is before the first element in the GamerCollection.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Syntax

private void System.Collections.IEnumerator.Reset ()

Exceptions

Exception type Condition
InvalidOperationException

The collection was modified after the enumerator was created.

Remarks

An enumerator remains valid as long as the collection remains unchanged. If changes, such as adding, modifying, or deleting elements are made to the collection, the enumerator is irrecoverably invalidated and the next call to the MoveNext method or the System.Collections.IEnumerator.Reset method throws an InvalidOperationException.

Note

Notes to Implementers: All calls to System.Collections.IEnumerator.Reset must result in the same state for the enumerator. The preferred implementation is to move the enumerator to the beginning of the collection, before the first element. This invalidates the enumerator if the collection has been modified since the enumerator was created, which is consistent with MoveNext and Current.

See Also

Reference

GamerCollection.GamerCollectionEnumerator Generic Structure
GamerCollection.GamerCollectionEnumerator Members
Microsoft.Xna.Framework.GamerServices Namespace

Platforms

Xbox 360, Windows XP SP2, Windows Vista, Zune