AutomationInteropProvider.ClientsAreListening 속성

정의

UI 자동화 클라이언트 애플리케이션이 UI 자동화 이벤트에 구독되는지 여부를 지정하는 값을 가져옵니다.

public:
 static property bool ClientsAreListening { bool get(); };
public static bool ClientsAreListening { get; }
member this.ClientsAreListening : bool
Public Shared ReadOnly Property ClientsAreListening As Boolean

속성 값

Boolean

클라이언트에서 이벤트를 구독하면 true이고, 구독하지 않으면 false입니다.

예제

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

적용 대상

추가 정보