IRawElementProviderFragment.GetRuntimeId 메서드

정의

요소의 런타임 식별자를 검색합니다.

public:
 cli::array <int> ^ GetRuntimeId();
public int[] GetRuntimeId ();
abstract member GetRuntimeId : unit -> int[]
Public Function GetRuntimeId () As Integer()

반환

Int32[]

요소의 고유 런타임 식별자입니다.

예제

다음 예제 코드에서는 목록 상자 내의 항목과 같은 조각 내의 요소에 의해 이 메서드의 구현을 보여 냅니다. 항목에는 조각의 이 instance 고유한 식별자가 있으며 AppendRuntimeId 값은 메서드에서 반환된 식별자가 UI 자동화 트리에서 고유하도록 합니다.

/// <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

설명

구현은 창 핸들에 해당하는 요소에 대해 를 반환 null 해야 합니다. 다른 요소는 를 포함하는 AppendRuntimeId배열과 조각 내에서 고유한 값을 반환해야 합니다.

조각 내에서 고유성을 보장하는 것은 공급자의 책임입니다. 예를 들어 목록의 각 항목은 개별적으로 번호가 매겨져야 합니다. UI 자동화 엔진은 값을 변환 AppendRuntimeId 하여 식별자가 모든 인스턴스에서 고유하도록 합니다.

적용 대상

추가 정보