AutomationInteropProvider.ClientsAreListening Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a value that specifies whether any UI Automation client application is subscribed to UI Automation events.
public:
static property bool ClientsAreListening { bool get(); };
public static bool ClientsAreListening { get; }
static member ClientsAreListening : bool
Public Shared ReadOnly Property ClientsAreListening As Boolean
Property Value
true
if a client is subscribed to events; otherwise false
.
Examples
/// <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
Applies to
See also
Colaborar con nosotros en GitHub
El origen de este contenido se puede encontrar en GitHub, donde también puede crear y revisar problemas y solicitudes de incorporación de cambios. Para más información, consulte nuestra guía para colaboradores.