Пример #1
0
		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);
			}
		}
Пример #2
0
		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);
		}
Пример #3
0
		internal void HandleAutomationEventRaised (AutomationEventEventArgs args)
		{
			if (args.Event == AutomationEvents.StructureChanged)
				HandleStructureChanged ();

			if (AutomationEventRaised != null)
				AutomationEventRaised (args.Peer, args);
		}