Automation.AddAutomationEventHandler Metoda

Definicja

Rejestruje metodę, która obsługuje automatyzacja interfejsu użytkownika zdarzeń.

public:
 static void AddAutomationEventHandler(System::Windows::Automation::AutomationEvent ^ eventId, System::Windows::Automation::AutomationElement ^ element, System::Windows::Automation::TreeScope scope, System::Windows::Automation::AutomationEventHandler ^ eventHandler);
public static void AddAutomationEventHandler (System.Windows.Automation.AutomationEvent eventId, System.Windows.Automation.AutomationElement element, System.Windows.Automation.TreeScope scope, System.Windows.Automation.AutomationEventHandler eventHandler);
static member AddAutomationEventHandler : System.Windows.Automation.AutomationEvent * System.Windows.Automation.AutomationElement * System.Windows.Automation.TreeScope * System.Windows.Automation.AutomationEventHandler -> unit
Public Shared Sub AddAutomationEventHandler (eventId As AutomationEvent, element As AutomationElement, scope As TreeScope, eventHandler As AutomationEventHandler)

Parametry

eventId
AutomationEvent

Identyfikator zdarzenia, które będzie obsługiwane przez metodę.

element
AutomationElement

Element automatyzacja interfejsu użytkownika do skojarzenia z programem obsługi zdarzeń.

scope
TreeScope

Zakres zdarzeń do obsłużenia; oznacza to, czy są one na samym elemecie, czy na jego przodkach i potomkach.

eventHandler
AutomationEventHandler

Metoda wywoływana w przypadku wystąpienia określonego zdarzenia.

Uwagi

Niektóre klasy, takie jak GridPattern, uwidaczniają pola identyfikujące zdarzenia specyficzne dla klasy. Metoda AddAutomationEventHandler udostępnia mechanizm, który umożliwia rejestrowanie programów obsługi dla tych zdarzeń.

eventHandlermoże być wystąpieniem metody lub odwołaniem do metody (AddressOf w Visual Basic).

Dotyczy

Zobacz też