AutomationEventArgs(AutomationEvent) 생성자

정의

AutomationEventArgs 클래스의 새 인스턴스를 초기화합니다.

public:
 AutomationEventArgs(System::Windows::Automation::AutomationEvent ^ eventId);
public AutomationEventArgs (System.Windows.Automation.AutomationEvent eventId);
new System.Windows.Automation.AutomationEventArgs : System.Windows.Automation.AutomationEvent -> System.Windows.Automation.AutomationEventArgs
Public Sub New (eventId As AutomationEvent)

매개 변수

eventId
AutomationEvent

이벤트 식별자입니다.

예제

다음 코드에서는 UI 자동화 공급자를 만들 수는 어떻게는 AutomationEventArgs 이벤트를 발생 시킵니다.

/// <summary>
/// Raises an event when a control is invoked.
/// </summary>
/// <param name="provider">The UI Automation provider for the control.</param>
private void RaiseInvokeEvent(IRawElementProviderSimple provider)
{
    if (AutomationInteropProvider.ClientsAreListening)
    {
        AutomationEventArgs args = 
            new AutomationEventArgs(InvokePatternIdentifiers.InvokedEvent);
        AutomationInteropProvider.RaiseAutomationEvent(InvokePatternIdentifiers.InvokedEvent, 
            provider, args);
    }
}
''' <summary>
''' Raises an event when a control is invoked.
''' </summary>
''' <param name="provider">The UI Automation provider for the control.</param>
Private Sub RaiseInvokeEvent(ByVal provider As IRawElementProviderSimple)
    If AutomationInteropProvider.ClientsAreListening Then
        Dim args As New AutomationEventArgs(InvokePatternIdentifiers.InvokedEvent)
        AutomationInteropProvider.RaiseAutomationEvent(InvokePatternIdentifiers.InvokedEvent, provider, args)
    End If

End Sub

적용 대상