IRawElementProviderFragment.GetRuntimeId Metoda

Definicja

Pobiera identyfikator środowiska uruchomieniowego elementu.

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

Zwraca

Int32[]

Unikatowy identyfikator czasu wykonywania elementu.

Przykłady

Poniższy przykładowy kod przedstawia implementację tej metody za pomocą elementu w obrębie fragmentu, takiego jak element w polu listy. Element ma własny unikatowy identyfikator w tym wystąpieniu fragmentu, a AppendRuntimeId wartość zapewnia, że identyfikator zwrócony przez metodę jest unikatowy w drzewie automatyzacja interfejsu użytkownika.

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

Uwagi

Implementacje powinny zwracać null element odpowiadający uchwytowi okna. Inne elementy powinny zwrócić tablicę zawierającą AppendRuntimeIdelement , po którym następuje wartość unikatowa w obrębie fragmentu.

Dostawca jest odpowiedzialny za zapewnienie unikatowości w obrębie fragmentu; na przykład każdy element na liście musi być numerowany indywidualnie. Aparat automatyzacja interfejsu użytkownika zapewnia, że identyfikator jest unikatowy we wszystkich wystąpieniach, tłumacząc AppendRuntimeId wartość.

Dotyczy

Zobacz też