AceEnumerator.Reset Método
Definição
Define o enumerador com sua posição inicial, que é antes do primeiro elemento na coleção GenericAce.Sets the enumerator to its initial position, which is before the first element in the GenericAce collection.
public:
virtual void Reset();
public void Reset ();
abstract member Reset : unit -> unit
override this.Reset : unit -> unit
Public Sub Reset ()
Implementações
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 permaneça inalterada.An enumerator remains valid as long as the collection remains unchanged. Se, por exemplo, adicionar, modificar ou excluir elementos forem feitos na coleção, o enumerador será invalidado de forma irrecuperável e a próxima chamada para o MoveNext método ou o Reset método lançará um InvalidOperationExceptionIf , 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 Reset method throws an InvalidOperationException
Notas aos Herdeiros
Todas as chamadas para Reset() devem resultar no mesmo estado para o enumerador.All calls to Reset() must result in the same state for the enumerator. A implementação preferida é mover o enumerador para o início da coleção, antes do primeiro elemento.The preferred implementation is to move the enumerator to the beginning of the collection, before the first element. Isso invalida o enumerador se a coleção tiver sido modificada desde que o enumerador foi criado, o que é consistente com MoveNext() e Current .This invalidates the enumerator if the collection has been modified since the enumerator was created, which is consistent with MoveNext() and Current.