AutomationEvent 클래스

정의

UI Automation 이벤트를 식별합니다.

public ref class AutomationEvent : System::Windows::Automation::AutomationIdentifier
public class AutomationEvent : System.Windows.Automation.AutomationIdentifier
type AutomationEvent = class
    inherit AutomationIdentifier
Public Class AutomationEvent
Inherits AutomationIdentifier
상속
AutomationEvent

예제

다음 예제에서는 이벤트 처리기에서 합니다 AutomationEvent 인수를와 비교 하는 이벤트를 AutomationEvent 호출 이벤트를 식별 하는 합니다.

/// <summary>
/// AutomationEventHandler delegate.
/// </summary>
/// <param name="src">Object that raised the event.</param>
/// <param name="e">Event arguments.</param>
private void OnUIAutomationEvent(object src, AutomationEventArgs e)
{
    // Make sure the element still exists. Elements such as tooltips
    // can disappear before the event is processed.
    AutomationElement sourceElement;
    try
    {
        sourceElement = src as AutomationElement;
    }
    catch (ElementNotAvailableException)
    {
        return;
    }
    if (e.EventId == InvokePattern.InvokedEvent)
    {
        // TODO Add handling code.
    }
    else
    {
        // TODO Handle any other events that have been subscribed to.
    }
}
''' <summary>
''' AutomationEventHandler delegate.
''' </summary>
''' <param name="src">Object that raised the event.</param>
''' <param name="e">Event arguments.</param>
Private Sub OnUIAutomationEvent(ByVal src As Object, ByVal e As AutomationEventArgs)
    ' Make sure the element still exists. Elements such as tooltips can disappear
    ' before the event is processed.
    Dim sourceElement As AutomationElement
    Try
        sourceElement = DirectCast(src, AutomationElement)
    Catch ex As ElementNotAvailableException
        Exit Sub
    End Try
    If e.EventId Is InvokePattern.InvokedEvent Then
        ' TODO Add handling code.
    Else
    End If
    ' TODO Handle any other events that have been subscribed to.
    Console.WriteLine("Event: " & e.EventId.ProgrammaticName)
End Sub

설명

이러한 유형의 식별자는 이벤트를 식별 하기 위해 다양 한 클래스의 필드로 찾을 수합니다 예를 들어 InvokedEvent합니다. 되기도 이벤트 UI 자동화 클라이언트에 전달 된 인수입니다.

사용자 지정 이벤트를 만들지는 것이 불가능 합니다.

속성

Id

내부 숫자 식별자를 가져옵니다.

(다음에서 상속됨 AutomationIdentifier)
ProgrammaticName

등록된 프로그래밍 이름을 가져옵니다.

(다음에서 상속됨 AutomationIdentifier)

메서드

CompareTo(Object)

AutomationIdentifier를 다른 AutomationIdentifier와 비교합니다.

(다음에서 상속됨 AutomationIdentifier)
Equals(Object)

지정된 AutomationIdentifier가 이 AutomationIdentifier와 같은지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 AutomationIdentifier)
GetHashCode()

이 UI 자동화 식별자에 대한 해시 코드를 반환합니다.

(다음에서 상속됨 AutomationIdentifier)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
LookupById(Int32)

지정된 숫자 식별자를 캡슐화하는 AutomationEvent를 가져옵니다.

MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상

추가 정보