internal void HandleAutomationEventRaised(AutomationEventEventArgs args) { if (args.Event == AutomationEvents.StructureChanged) { HandleStructureChanged(); } if (AutomationEventRaised != null) { AutomationEventRaised(args.Peer, args); } }
private void OnAutomationEventRaised( object o, AutomationEventEventArgs args) { if (args.Peer == null) { return; } Log.Info("OnAutomationEventRaised: Peer = {0}, Event = {1}", args.Peer, args.Event); Adapter adapter = DynamicAdapterFactory.Instance.GetAdapter(args.Peer, false); if (adapter == null) { return; } adapter.HandleAutomationEventRaised(args); }
private void OnAutomationEventRaised(object o, AutomationEventEventArgs args) { bool notifyStateChanged = false; switch (args.Event) { case AutomationEvents.SelectionItemPatternOnElementSelected: // We have to notify that we are the only selected item, // we do that by unselecting previous selected items. SelectionItem.ClearSelectedItems(this); if (!WasSelected) { notifyStateChanged = true; SelectionItem.AddSelectedItem(this); } break; case AutomationEvents.SelectionItemPatternOnElementAddedToSelection: if (!WasSelected) { notifyStateChanged = true; SelectionItem.AddSelectedItem(this); } break; case AutomationEvents.SelectionItemPatternOnElementRemovedFromSelection: if (WasSelected) { notifyStateChanged = true; SelectionItem.RemoveSelectedItem(this); } break; } if (notifyStateChanged) { WasSelected = !WasSelected; adapter.NotifyStateChange(Atk.StateType.Selected); } }
protected virtual void OnAutomationEvent(AutomationEventEventArgs e) { AutomationEvent?.Invoke(this, e); }