AutomationEvent AutomationEvent AutomationEvent AutomationEvent Class

정의

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

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 호출 이벤트를 식별 하는 합니다.In the following example event handler, the AutomationEvent in the event arguments is compared with the AutomationEvent that identifies the Invoked event.

/// <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합니다.Identifiers of these types are found as fields in various classes to identify events; for example, InvokedEvent. 되기도 이벤트 UI 자동화 클라이언트에 전달 된 인수입니다.They are also found in the event arguments passed to UI Automation clients.

사용자 지정 이벤트를 만들지는 것이 불가능 합니다.It is not possible to create custom events.

메서드

CompareTo(Object) CompareTo(Object) CompareTo(Object) CompareTo(Object)

AutomationIdentifier를 다른 AutomationIdentifier와 비교합니다.Compares this AutomationIdentifier with another AutomationIdentifier.

(Inherited from AutomationIdentifier)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

지정된 AutomationIdentifier가 이 AutomationIdentifier와 같은지 여부를 나타내는 값을 반환합니다.Returns a value indicating whether the supplied AutomationIdentifier is equivalent to this AutomationIdentifier.

(Inherited from AutomationIdentifier)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

UI 자동화UI Automation 식별자의 해시 코드를 반환합니다.Returns the hash code for this UI 자동화UI Automation identifier.

(Inherited from AutomationIdentifier)
GetType() GetType() GetType() GetType()

현재 인스턴스의 Type을 가져옵니다.Gets the Type of the current instance.

(Inherited from Object)
LookupById(Int32) LookupById(Int32) LookupById(Int32) LookupById(Int32)

지정된 숫자 식별자를 캡슐화하는 AutomationEvent를 가져옵니다.Retrieves an AutomationEvent that encapsulates the specified numerical identifier.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

현재 개체를 나타내는 문자열을 반환합니다.Returns a string that represents the current object.

(Inherited from Object)

속성

Id Id Id Id

내부 숫자 식별자를 가져옵니다.Gets the underlying numerical identifier.

(Inherited from AutomationIdentifier)
ProgrammaticName ProgrammaticName ProgrammaticName ProgrammaticName

등록된 프로그래밍 이름을 가져옵니다.Gets the registered programmatic name.

(Inherited from AutomationIdentifier)

적용 대상

추가 정보