ApplicationTrustEnumerator 類別

定義

代表 ApplicationTrustCollection 集合中 ApplicationTrust 物件的列舉程式。

public ref class ApplicationTrustEnumerator sealed : System::Collections::IEnumerator
public sealed class ApplicationTrustEnumerator : System.Collections.IEnumerator
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class ApplicationTrustEnumerator : System.Collections.IEnumerator
type ApplicationTrustEnumerator = class
    interface IEnumerator
[<System.Runtime.InteropServices.ComVisible(true)>]
type ApplicationTrustEnumerator = class
    interface IEnumerator
Public NotInheritable Class ApplicationTrustEnumerator
Implements IEnumerator
繼承
ApplicationTrustEnumerator
屬性
實作

備註

列舉值只允許讀取集合中的資料。 列舉值無法用來修改基礎集合。

一開始,列舉程式位在集合中的第一個項目之前。 方法 Reset 也會將列舉值帶回這個位置。 在這個位置,呼叫 Current 屬性會擲回例外狀況。 因此,您必須呼叫 MoveNext 方法,將列舉值前移至集合的第一個專案,再讀取 屬性的值 Current

Current 會傳回相同的物件直到呼叫 MoveNextResetMoveNext 會將 Current 設定為下一個項目。

在超過集合的末端後,列舉值會放置在集合最後一個元素之後,並且呼叫 MoveNext 會傳回 false。 如果最後一 MoveNext 次呼叫傳 false 回 ,則呼叫 Current 會擲回例外狀況。 若要重設為 Current 集合的第一個專案,請呼叫 Reset ,後面接著呼叫 MoveNext

只要集合維持不變,列舉值就仍維持有效。 如果對集合進行變更,例如新增、修改或刪除專案,列舉值就會無法復原,而下一次呼叫 MoveNextResetInvalidOperationException 擲回例外狀況。 如果在呼叫 MoveNextCurrent 之間修改集合, Current 則會傳回它目前設定的專案,即使列舉值已經失效也一樣。

列舉程式沒有集合的獨佔存取權,因此,列舉集合內容本質上並不是安全的執行緒程序。 即使集合經過同步化,其他的執行緒仍可修改該集合,使列舉值擲回例外狀況。 若要保證列舉過程的執行緒安全,您可以在整個列舉過程中鎖定集合,或攔截由其他執行緒的變更所造成的例外狀況。

屬性

Current

取得 ApplicationTrust 集合中目前的 ApplicationTrustCollection 物件。

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
MoveNext()

移至 ApplicationTrustCollection 集合中的下一個項目。

Reset()

將列舉值重設為 ApplicationTrustCollection 集合的開頭。

ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

明確介面實作

IEnumerator.Current

取得 Object 集合中目前的 ApplicationTrustCollection

適用於