共用方式為


AutomationInteropProvider.AppendRuntimeId 欄位

定義

包含值 (傳回為使用者介面自動化提供者傳遞給 GetRuntimeId() 之陣列的第一個項目時),這個值表示識別碼是局部,並應該附加至基底提供者所提供的識別碼。

public: int AppendRuntimeId = 3;
public const int AppendRuntimeId = 3;
val mutable AppendRuntimeId : int
Public Const AppendRuntimeId As Integer  = 3

欄位值

Value = 3

範例

下列範例是清單專案的 實作 IRawElementProviderFragment.GetRuntimeId

/// <summary>
/// Gets the runtime identifier of the UI Automation element.
/// </summary>
/// <remarks>
/// myID is a unique identifier for the item within this instance of the list.
/// </remarks>
public int[] GetRuntimeId()
{
    return new int[] { AutomationInteropProvider.AppendRuntimeId, myID };
}
''' <summary>
''' Gets the runtime identifier of the UI Automation element.
''' </summary>
''' <remarks>
''' myID is a unique identifier for the item within this instance of the list.
''' </remarks>
Public Function GetRuntimeId() As Integer() _
    Implements IRawElementProviderFragment.GetRuntimeId

    Return New Integer() {AutomationInteropProvider.AppendRuntimeId, myID}

End Function 'GetRuntimeId

備註

此欄位通常用於片段中未直接裝載于視窗中之專案的 實 GetRuntimeId 作。

適用於