상속: Atk.Object, Atk.ComponentImplementor
예제 #1
0
		public BaseActionImplementor (Adapter adapter, AutomationPeer peer)
			: base (adapter, peer)
		{
			// TODO: also do this in response to patterns being
			// added/removed
			RefreshActions ();
		}
예제 #2
0
		public ExpandCollapseInvokeToggle (Adapter adapter, AutomationPeer peer)
			: base (adapter, peer)
		{
			adapter.AutomationPropertyChanged
				+= new EventHandler<AutomationPropertyChangedEventArgs> (
					OnAutomationPropertyChanged);
		}
예제 #3
0
파일: GridTable.cs 프로젝트: mono/uia2atk
		public GridTable (Adapter adapter, AutomationPeer peer) : base (adapter, peer)
		{
			this.peer = peer;

			this.tableProvider = (ITableProvider) peer.GetPattern (
				PatternInterface.Table);
		}
예제 #4
0
파일: Calendar.cs 프로젝트: mono/uia2atk
		public Calendar (Adapter adapter, AutomationPeer peer)
			: base (adapter, peer)
		{
			FrameworkElementAutomationPeer feap = peer as FrameworkElementAutomationPeer;
			if (feap == null)
				return;

			// XXX: We can't link to System.Windows.Controls, so
			// we'll use reflection instead.

			UIElement calendar = feap.Owner;

			Type t = calendar.GetType ();
			if (t.Namespace != "System.Windows.Controls" || t.Name != "Calendar")
				return;

			// XXX SUCH A HACK! XXX
			// Workaround a bug in CalendarAutomationPeer.
			// Even though its selection and NameProperty
			// change, it does not send the proper change
			// notifications via the peer.  So we fake them.
			EventInfo ei = t.GetEvent ("SelectedDatesChanged");
			ei.AddEventHandler (calendar,
			                    new EventHandler<SelectionChangedEventArgs> (OnSelectedDatesChanged));
		}
예제 #5
0
파일: RadioButton.cs 프로젝트: mono/uia2atk
		public RadioButton (Adapter adapter, AutomationPeer peer)
			: base (adapter, peer)
		{
			adapter.AutomationPropertyChanged
				+= new EventHandler<AutomationPropertyChangedEventArgs> (
					OnAutomationPropertyChanged);
		}
예제 #6
0
파일: Selection.cs 프로젝트: mono/uia2atk
		public Selection (Adapter adapter, AutomationPeer peer) : base (adapter, peer)
		{
			this.selectionProvider = (ISelectionProvider) peer.GetPattern (
				PatternInterface.Selection);

			adapter.AutomationPropertyChanged += (o, args) => {
				if (args.Property == SelectionPatternIdentifiers.SelectionProperty)
					adapter.EmitSignal ("selection_changed");
			};
		}
예제 #7
0
파일: RangeValue.cs 프로젝트: mono/uia2atk
		public RangeValue (Adapter adapter, AutomationPeer peer)
			: base (adapter, peer)
		{
			this.rangeValueProvider = (IRangeValueProvider) peer.GetPattern (
				PatternInterface.RangeValue);

			adapter.AutomationPropertyChanged
				+= new EventHandler<AutomationPropertyChangedEventArgs> (
					OnAutomationPropertyChanged);
		}
예제 #8
0
		public SelectionItem (Adapter adapter, AutomationPeer peer) : base (adapter, peer)
		{
			bool? isSelected = IsSelected;
			if (isSelected.HasValue)
				WasSelected = isSelected.Value;

			adapter.AutomationPropertyChanged
				+= new EventHandler<AutomationPropertyChangedEventArgs> (
				OnAutomationPropertyChanged);

			adapter.AutomationEventRaised
				+= new EventHandler<AutomationEventEventArgs> (
				OnAutomationEventRaised);
		}
예제 #9
0
		public BasePatternImplementor (Adapter adapter, AutomationPeer peer)
		{
			this.adapter = adapter;
			this.peer = peer;
		}
예제 #10
0
파일: TabItem.cs 프로젝트: mono/uia2atk
		public TabItem (Adapter adapter, AutomationPeer peer) : base (adapter, peer)
		{
			adapter.AutomationPropertyChanged += (o, args) => {
				if (args.Property == SelectionItemPatternIdentifiers.IsSelectedProperty) {
					isSelectedChanged = true;
					newValue = (bool) args.NewValue;
				}
			};

			// XXX: Warning! Hack alert!
			//
			// TabItem's children are avaliable *only* when the TabItem is selected,
			// (its IsSelectedProperty is true). We are updating children here instead for
			// two reasons:
			//
			// 1. We can't modify the sources in System.Windows.Controls.dll because this
			//    dll is bundled in the packaged XAP, VS does this automatically. If we
			//    fix the sources in SWC.dll all applications built using VS *will fail*
			//    anyway.
			// 2. We are using both the AutomationPropertyEvent (IsSelected) and the event
			//    LayoutUpdated because the TabControl has *one* SelectedContent area, and
			//    this area is updated *after* raising the event. If we only use
			//    IsSelectedPropertyEvent we will always get the previous/unselected
			//    TabItem's children instead of the current/selected's.
			//
			FrameworkElement tabItem
				= ((FrameworkElementAutomationPeer) peer).Owner as FrameworkElement;
			if (tabItem != null) {
				tabItem.LayoutUpdated += (o, e) => {
					if (isSelectedChanged) {
						Adapter parentTabControl = ParentTabControl;

						// We don't have a parent let's update our children anyway.
						if (parentTabControl == null)
							adapter.HandleStructureChanged ();
						// We have a parent, let's update our children "the right way",
						// first the unselected TabItem then the selected TabItem.
						else {
							Adapter cachedTabItem = null;
							if (CachedTabItems.TryGetValue (parentTabControl,
							    out cachedTabItem)) {
								if (newValue) {
									cachedTabItem.HandleStructureChanged ();
									cachedTabItem.NotifyStateChange (Atk.StateType.Selected);

									adapter.HandleStructureChanged ();
									adapter.NotifyStateChange (Atk.StateType.Selected);
								} else {
									adapter.HandleStructureChanged ();
									adapter.NotifyStateChange (Atk.StateType.Selected);

									cachedTabItem.HandleStructureChanged ();
									cachedTabItem.NotifyStateChange (Atk.StateType.Selected);
								}
								CachedTabItems.Remove (parentTabControl);
							} else
								CachedTabItems.Add (parentTabControl, adapter);
						}
						isSelectedChanged = false;
						newValue = false;
					}
				};
			}
		}
예제 #11
0
파일: Adapter.cs 프로젝트: mono/uia2atk
		internal int GetIndexOfChild (Adapter child)
		{
			CacheChildren ();

			if (children == null || child == null)
				return -1;

			// Intentionally use Children list instead of
			// Peer.GetChildren () as we're concerned with what is
			// currently displayed to the user
			lock (ChildrenLock) {
				return children.IndexOf (child.Peer);
			}
		}