/// <summary> /// Handler for property change events /// </summary> /// <param name="src">The source whose properties changed.</param> /// <param name="e">Event arguments.</param> private void OnPropertyChange(object src, AutomationPropertyChangedEventArgs e) { if (src == null) { return; } AutomationEventVerifier.EventFired(_targetEvent); RemovePropertyChangeHandler(); }
/// <summary> /// Automation Event handler /// </summary> /// <param name="src">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.Automation.AutomationEventArgs"/> instance containing the event data.</param> private void OnAutomationEvent(object src, AutomationEventArgs e) { if (src == null) { return; } if (e.EventId != _targetEvent.EventType) { AutomationEventVerifier.EventFired(_targetEvent); return; } RemoveHandler(); }