AutomationElementMode 列舉

定義

包含值,這些值會指定傳回使用者介面自動化項目時所使用的參考型別。 這些值用於 AutomationElementMode 屬性。

public enum class AutomationElementMode
public enum AutomationElementMode
type AutomationElementMode = 
Public Enum AutomationElementMode
繼承
AutomationElementMode

欄位

Full 1

指定傳回的專案具有基礎 UI 的完整參考。

None 0

指定傳回的專案沒有基礎 UI 的參考,而且只包含快取的資訊。 本模式可能的用途,例如:不必取得項目本身的參考,即可擷取清單方塊內項目的名稱。

範例

下列範例示範如何在 上 CacheRequest 設定模式。

// Set up the request.
CacheRequest cacheRequest = new CacheRequest();

// Do not get a full reference to the cached objects, only to their cached properties and patterns.
cacheRequest.AutomationElementMode = AutomationElementMode.None;
' Set up the request.
Dim cacheRequest As New CacheRequest()

' Do not get a full reference to the cached objects, only to their cached properties and patterns.
cacheRequest.AutomationElementMode = AutomationElementMode.None

備註

Full 是預設值,並指定傳回的專案包含基礎使用者介面的完整參考, (UI) 。 None 指定傳回的專案沒有基礎 UI 的參考,而且只包含快取的資訊。

SetFocusGetCurrentPropertyValue 專案上的某些作業需要完整參考;嘗試在沒有任何結果 InvalidOperationException 的專案上執行這些作業。

當只需要屬性時,使用 None 會更有效率,因為它可避免設定完整參考時所需的額外負荷。

適用於

另請參閱