IEnumeratorContract<T>.Reset Método

Definição

Define o enumerador com sua posição inicial, que é antes do primeiro elemento da coleção.Sets the enumerator to its initial position, which is before the first element in the collection.

public:
 void Reset();
public void Reset ();
abstract member Reset : unit -> unit
Public Sub Reset ()

Exceções

A coleção foi modificada depois da criação do enumerador.The collection was modified after the enumerator was created.

Comentários

Um enumerador permanece válido desde que a coleção continue inalterada.An enumerator remains valid as long as the collection remains unchanged. Se forem feitas alterações na coleção, como adicionar, modificar ou excluir elementos, o enumerador será invalidado de forma irrecuperável e a próxima chamada para MoveNext ou Reset lançar um InvalidOperationException .If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to MoveNext or Reset throws an InvalidOperationException.

Aplica-se a