Aracılığıyla paylaş


AutomationInteropProvider.RaiseAutomationEvent Yöntem

Tanım

Bir desen olayı veya özel olay oluşturur.

public:
 static void RaiseAutomationEvent(System::Windows::Automation::AutomationEvent ^ eventId, System::Windows::Automation::Provider::IRawElementProviderSimple ^ provider, System::Windows::Automation::AutomationEventArgs ^ e);
public static void RaiseAutomationEvent (System.Windows.Automation.AutomationEvent eventId, System.Windows.Automation.Provider.IRawElementProviderSimple provider, System.Windows.Automation.AutomationEventArgs e);
static member RaiseAutomationEvent : System.Windows.Automation.AutomationEvent * System.Windows.Automation.Provider.IRawElementProviderSimple * System.Windows.Automation.AutomationEventArgs -> unit
Public Shared Sub RaiseAutomationEvent (eventId As AutomationEvent, provider As IRawElementProviderSimple, e As AutomationEventArgs)

Parametreler

eventId
AutomationEvent

Olay tanımlayıcısı.

provider
IRawElementProviderSimple

Olayla ilişkilendirilmiş öğe.

e
AutomationEventArgs

Olay hakkında bilgi.

Örnekler

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

Açıklamalar

Desen olayları yalnızca bir desen uygulaması tarafından tetiklenmemelidir. Örneğin, InvokedEvent denetim her çağrıldığında fare veya klavye girişi aracılığıyla Invoke tetiklenmelidir. Bu şekilde istemciler sistem olayları hakkında bilgi sahibi olabilir.

Şunlara uygulanır

Ayrıca bkz.