Automation.Compare 메서드

정의

지정된 매개 변수를 비교하여 같은 UI(사용자 인터페이스) 요소를 참조하는지 확인합니다.

오버로드

Compare(Int32[], Int32[])

ID(런타임 식별자)가 포함된 두 정수 배열을 비교하여 해당 콘텐츠가 동일한지 여부를 확인합니다.

Compare(AutomationElement, AutomationElement)

두 UI 자동화 요소를 비교하여 둘 다 동일한 UI 요소를 참조하는 경우 반환 true 합니다.

Compare(Int32[], Int32[])

ID(런타임 식별자)가 포함된 두 정수 배열을 비교하여 해당 콘텐츠가 동일한지 여부를 확인합니다.

public:
 static bool Compare(cli::array <int> ^ runtimeId1, cli::array <int> ^ runtimeId2);
public static bool Compare (int[] runtimeId1, int[] runtimeId2);
static member Compare : int[] * int[] -> bool
Public Shared Function Compare (runtimeId1 As Integer(), runtimeId2 As Integer()) As Boolean

매개 변수

runtimeId1
Int32[]

비교할 첫 번째 런타임 ID입니다.

runtimeId2
Int32[]

비교할 두 번째 런타임 ID입니다.

반환

Boolean

true 비교된 런타임 ID가 동일한 UI(사용자 인터페이스) 요소를 참조하는 경우 그렇지 않으면 false.

예제

다음 예제 함수는 런타임 ID가 런타임 ID 목록에 있는지 여부를 결정합니다.

private int RuntimeIdListed(int[] runtimeId, ArrayList runtimeIds)
{
    for (int x = 0; x < runtimeIds.Count; x++)
    {
        int[] listedId = (int[])runtimeIds[x];
        if (Automation.Compare(listedId, runtimeId))
        {
            return x;
        }
    }
    return -1;
}
Private Function RuntimeIdListed(ByVal runtimeId() As Integer, ByVal runtimeIds As ArrayList) As Integer 
    Dim x As Integer
    For x = 0 To runtimeIds.Count - 1
        Dim listedId As Integer() = CType(runtimeIds(x), Integer())
        If Automation.Compare(listedId, runtimeId) Then
            Return x
        End If
    Next x
    Return - 1

End Function 'RuntimeIdListed

설명

인수 중 하나가 null 참조(NothingVisual Basic) Compare 이면 예외를 ArgumentNullException throw합니다.

추가 정보

적용 대상

Compare(AutomationElement, AutomationElement)

두 UI 자동화 요소를 비교하여 둘 다 동일한 UI 요소를 참조하는 경우 반환 true 합니다.

public:
 static bool Compare(System::Windows::Automation::AutomationElement ^ el1, System::Windows::Automation::AutomationElement ^ el2);
public static bool Compare (System.Windows.Automation.AutomationElement el1, System.Windows.Automation.AutomationElement el2);
static member Compare : System.Windows.Automation.AutomationElement * System.Windows.Automation.AutomationElement -> bool
Public Shared Function Compare (el1 As AutomationElement, el2 As AutomationElement) As Boolean

매개 변수

el1
AutomationElement

비교할 첫 번째 UI 자동화 요소입니다.

el2
AutomationElement

비교할 두 번째 UI 자동화 요소입니다.

반환

Boolean

true if the run time identifiers of the UI elements are the same; otherwise false.

설명

인수 중 하나가 null 참조(NothingVisual Basic) Compare 이면 예외를 ArgumentNullException throw합니다.

이 메서드는 개체의 같음 연산자에 AutomationElement 해당합니다.

추가 정보

적용 대상