TimerEventSubscriptionCollection.GetEnumerator Método

Definição

Retorna um enumerador que itera por meio de TimerEventSubscriptionCollection.Returns an enumerator that iterates through the TimerEventSubscriptionCollection.

public:
 virtual System::Collections::IEnumerator ^ GetEnumerator();
public System.Collections.IEnumerator GetEnumerator ();
abstract member GetEnumerator : unit -> System.Collections.IEnumerator
override this.GetEnumerator : unit -> System.Collections.IEnumerator
Public Function GetEnumerator () As IEnumerator

Retornos

IEnumerator

Um IEnumerator para o TimerEventSubscriptionCollection.An IEnumerator for the TimerEventSubscriptionCollection.

Implementações

Comentários

O acesso ao TimerEventSubscriptionCollection é sincronizado; no entanto, a enumeração por meio de uma coleção é intrinsecamente não um procedimento de thread seguro.Access to the TimerEventSubscriptionCollection is synchronized; however, enumerating through a collection is intrinsically not a thread safe procedure. 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 forem feitas alterações na coleção, como adicionar, modificar ou excluir elementos, o enumerador será invalidado de maneira irrevogável e seu comportamento permanecerá indefinido.If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. O enumerador não tem acesso exclusivo à coleção; Portanto, a enumeração por meio de uma coleção é intrinsecamente não um procedimento de thread seguro.The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread safe procedure. Para garantir a segurança do thread durante a enumeração, você pode bloquear o TimerEventSubscriptionCollection durante toda a enumeração usando o SyncRoot .To guarantee thread safety during enumeration, you can lock the TimerEventSubscriptionCollection during the entire enumeration by using SyncRoot.

Aplica-se a