AutomationInteropProvider.ClientsAreListening Propriedade

Definição

Obtém um valor que especifica se algum aplicativo cliente Automação da Interface do Usuário está inscrito em eventos de Automação da Interface do Usuário.

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

Valor da propriedade

Boolean

true se um cliente estiver inscrito em eventos; caso contrário false.

Exemplos

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

Aplica-se a

Confira também