TimerEventSubscriptionCollection.GetEnumerator 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳一個遍歷 的 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
傳回
A IEnumerator 代表 TimerEventSubscriptionCollection。
實作
備註
存取 是 TimerEventSubscriptionCollection 同步的;然而,透過集合列舉本質上並非執行緒安全的程序。 只要集合未曾改變,列舉器仍然有效。 若對集合進行變更,例如新增、修改或刪除元素,列舉器將無法恢復,其行為也無法定義。 列舉員並非擁有收藏的獨家存取權;因此,透過集合列舉本質上並非執行緒安全的程序。 為了確保列舉過程中執行緒的安全,你可以在TimerEventSubscriptionCollection整個列舉過程中鎖定 。SyncRoot