public ScrollBars(AutomationElement automationElement, ActionListener actionListener, ScrollBarButtonAutomationIds hScrollBarButtonAutomationIds, ScrollBarButtonAutomationIds vScrollBarButtonAutomationIds) { this.actionListener = actionListener; this.hScrollBarButtonAutomationIds = hScrollBarButtonAutomationIds; this.vScrollBarButtonAutomationIds = vScrollBarButtonAutomationIds; finder = new AutomationElementFinder(automationElement); }
public UIItem(AutomationElement automationElement, ActionListener actionListener) { if (null == automationElement) throw new NullReferenceException(); this.automationElement = automationElement; this.actionListener = actionListener; factory = new PrimaryUIItemFactory(new AutomationElementFinder(automationElement)); }
public void addActionListener(ActionListener actionListener) { lock (actionListeners) { actionListeners.Add(actionListener); } }
private IUIItem Create(ContainerItemFactory containerItemFactory, SearchCriteria searchCriteria, ActionListener actionListener) { IUIItem item = containerItemFactory.Get(searchCriteria, actionListener); if (item == null) return null; windowItemsMap.Add(item.Location, searchCriteria); return item; }
protected ScrollBar(AutomationElement automationElement, ActionListener actionListener, ScrollBarButtonAutomationIds automationIds) : base(automationElement, actionListener) { this.automationIds = automationIds; var finder = new AutomationElementFinder(automationElement); primaryUIItemFactory = new PrimaryUIItemFactory(finder); }
private ToolTip GetToolTip(UIItem uiItem, ActionListener actionListener) { mouse.Click(uiItem.Bounds.Center()); actionListener.ActionPerformed(Action.WindowMessage); Thread.Sleep(CoreAppXmlConfiguration.Instance.TooltipWaitTime); return ToolTip.GetFrom(uiItem.Bounds.Center()); }
private static SuggestionList WaitTill(ActionListener actionListener, string failureMessage, Clock.Matched matched) { Clock.Do getSuggestionList = () => Find(actionListener); Clock.Expired onExpiration = delegate { throw new UIActionException(failureMessage + Constants.BusyMessage); }; return (SuggestionList) new Clock(CoreAppXmlConfiguration.Instance.SuggestionListTimeout).Perform(getSuggestionList, matched, onExpiration); }
internal static IScrollBars CreateBars(AutomationElement parentElement, ActionListener listener) { var frameworkId = parentElement.Current.FrameworkId; if (frameworkId == Constants.WPFFrameworkId) return new WPFScrollBars(parentElement, listener); if (frameworkId == Constants.SilverlightFrameworkId) return new ScrollBars(parentElement, listener, new SilverlightHScrollBarButtonAutomationIds(), new SilverlightVScrollBarButtonAutomationIds()); return new ScrollBars(parentElement, listener, new DefaultScrollBarButtonAutomationIds(), new DefaultScrollBarButtonAutomationIds()); }
public virtual IUIItem Create(SearchCriteria searchCriteria, ActionListener actionListener) { if (searchCriteria.IsIndexed) { UIItemCollection collection = CreateAll(searchCriteria, actionListener); return searchCriteria.IndexedItem(collection); } return dictionaryMappedItemFactory.Create(Finder.Descendant(searchCriteria.AutomationCondition), actionListener, searchCriteria.CustomItemType); }
public virtual IUIItem Get(SearchCriteria searchCriteria, ActionListener uiItemActionListener) { IUIItem item = Find(searchCriteria); if (item == null || item is UIItemContainer) { //Cannot create dynamic proxy for class which has methods using generics. Also its not required to intercept methods on UIItem containers return item; } return UIItemProxyFactory.Create(item, uiItemActionListener); }
private static SuggestionList WaitTill(ActionListener actionListener, string failureMessage, Predicate<SuggestionList> shouldRetry) { try { return Retry.For(() => Find(actionListener), shouldRetry, CoreAppXmlConfiguration.Instance.SuggestionListTimeout); } catch (Exception ex) { throw new UIActionException(failureMessage + Constants.BusyMessage, ex); } }
private bool TryGetPopupMenu(AutomationSearchCondition[] searchConditions, ActionListener actionListener, out PopUpMenu popUpMenu) { var element = Retry.For(() => Finder.Child(searchConditions), CoreAppXmlConfiguration.Instance.PopupTimeout(), TimeSpan.FromMilliseconds(100)); if (element == null) { popUpMenu = null; return false; } popUpMenu = new PopUpMenu(element, actionListener); return true; }
public virtual PopUpMenu WPFPopupMenu(ActionListener actionListener) { var searchConditions = new[] { AutomationSearchCondition.ByControlType(ControlType.Window), AutomationSearchCondition.ByControlType(ControlType.Menu) }; PopUpMenu popUpMenu; TryGetPopupMenu(searchConditions, actionListener, out popUpMenu); return popUpMenu; }
public TableScrollBars(AutomationElementFinder finder, ActionListener actionListener, TableVerticalScrollOffset tableVerticalScrollOffset) { AutomationElement verticalScrollElement = finder.Child(AutomationSearchCondition.ByControlType(ControlType.Pane).OfName(UIItemIdAppXmlConfiguration.Instance.TableVerticalScrollBar)); verticalScrollBar = (verticalScrollElement == null) ? (IVScrollBar) new NullVScrollBar() : new TableVerticalScrollBar(verticalScrollElement, actionListener, tableVerticalScrollOffset); AutomationElement horizontalScrollElement = finder.Child(AutomationSearchCondition.ByControlType(ControlType.Pane).OfName(UIItemIdAppXmlConfiguration.Instance.TableHorizontalScrollBar)); horizontalScrollBar = (horizontalScrollElement == null) ? (IHScrollBar) new NullHScrollBar() : new TableHorizontalScrollBar(horizontalScrollElement, actionListener); }
private static SuggestionList Find(ActionListener actionListener) { AutomationElement dropDown = new AutomationElementFinder(AutomationElement.RootElement).Child(AutomationSearchCondition.ByClassName("Auto-Suggest Dropdown")); if (dropDown == null) return null; AutomationElement listViewElement = new AutomationElementFinder(dropDown).Child(AutomationSearchCondition.ByControlType(ControlType.DataGrid)); if (listViewElement == null) return null; return new ListView(listViewElement, actionListener); }
public virtual void DoubleClickOutsideToolTip(UIItem uiItem, ActionListener actionListener) { actionListener.ActionPerforming(uiItem); ToolTip toolTip = GetToolTip(uiItem, actionListener); if (toolTip == null) mouse.DoubleClick(uiItem.Bounds.Center(), actionListener); else { WhiteLogger.Instance.Debug("Found tooltip DoubleClicking outside tooltip bounds"); mouse.DoubleClick(toolTip.LeftOutside(uiItem.Bounds), actionListener); } }
public virtual UIItemCollection ItemsWithin(Rect bounds, ActionListener actionListener) { var collection = new UIItemCollection(); List<AutomationElement> descendants = Finder.Descendants(AutomationSearchCondition.All); foreach (AutomationElement automationElement in descendants) { if (!bounds.Contains(automationElement.Current.BoundingRectangle)) continue; var factory = new DictionaryMappedItemFactory(); collection.Add(factory.Create(automationElement, actionListener)); } return collection; }
public virtual void RightClickOutsideToolTip(UIItem uiItem, ActionListener actionListener) { actionListener.ActionPerforming(uiItem); ToolTip toolTip = GetToolTip(uiItem, actionListener); if (toolTip == null) { //Because mouse has already been moved mouse.RightClickHere(actionListener); } else { WhiteLogger.Instance.Debug("Found tooltip RightClicking outside tooltip bounds"); mouse.RightClick(toolTip.LeftOutside(uiItem.Bounds), actionListener); } }
/*public Player owner { get { if(mFlockUnit != null) { int index = Player.GroupToIndex(mFlockUnit.type); if(index >= 0 && index < Player.playerCount) { return Player.GetPlayer(index); } } return null; } }*/ protected override void Awake() { base.Awake(); mFlockUnit = GetComponentInChildren<FlockUnit>(); mListener = GetComponentInChildren<ActionListener>(); if(mFlockUnit != null) { mFlockUnit.groupMoveEnabled = false; } if(mListener != null) { mListener.enterCallback += OnActionEnter; mListener.hitEnterCallback += OnActionHitEnter; mListener.hitExitCallback += OnActionHitExit; mListener.finishCallback += OnActionFinish; } }
public virtual IUIItem Get(ContainerItemFactory containerItemFactory, SearchCriteria searchCriteria, ActionListener actionListener) { logger.DebugFormat("Finding item based on criteria: ({0}) on ({1})", searchCriteria, initializeOption.Identifier); Point location = windowItemsMap.GetItemLocation(searchCriteria); if (location.Equals(RectX.UnlikelyWindowPosition)) { logger.Debug("[PositionBasedSearch] Could not find based on position, finding using search."); return Create(containerItemFactory, searchCriteria, actionListener); } AutomationElement automationElement = AutomationElementX.GetAutomationElementFromPoint(location); if (automationElement != null && searchCriteria.AppliesTo(automationElement)) { IUIItem item = new DictionaryMappedItemFactory().Create(automationElement, actionListener, searchCriteria.CustomItemType); return UIItemProxyFactory.Create(item, actionListener); } logger.DebugFormat("[PositionBasedSearch] UIItem {0} changed its position, finding using search.", searchCriteria); return Create(containerItemFactory, searchCriteria, actionListener); }
public virtual void Send(string keysToType, ActionListener actionListener) { if (heldKeys.Count > 0) keysToType = keysToType.ToLower(); CapsLockOn = false; foreach (char c in keysToType) { short key = VkKeyScan(c); if (c.Equals('\r')) continue; if (ShiftKeyIsNeeded(key)) SendKeyDown((short) KeyboardInput.SpecialKeys.SHIFT, false); if (CtrlKeyIsNeeded(key)) SendKeyDown((short) KeyboardInput.SpecialKeys.CONTROL, false); if (AltKeyIsNeeded(key)) SendKeyDown((short) KeyboardInput.SpecialKeys.ALT, false); Press(key, false); if (ShiftKeyIsNeeded(key)) SendKeyUp((short) KeyboardInput.SpecialKeys.SHIFT, false); if (CtrlKeyIsNeeded(key)) SendKeyUp((short) KeyboardInput.SpecialKeys.CONTROL, false); if (AltKeyIsNeeded(key)) SendKeyUp((short) KeyboardInput.SpecialKeys.ALT, false); } actionListener.ActionPerformed(Action.WindowMessage); }
internal virtual void HoldKey(KeyboardInput.SpecialKeys key, ActionListener actionListener) { SendKeyDown((short)key, true); heldKeys.Add(key); actionListener.ActionPerformed(Action.WindowMessage); }
public Tree(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { finder = new AutomationElementFinder(automationElement); }
public TableHorizontalScrollBar(AutomationElement automationElement, ActionListener actionListener) { }
public virtual void PressSpecialKey(KeyboardInput.SpecialKeys key, ActionListener actionListener) { Send(key, true); actionListener.ActionPerformed(Action.WindowMessage); }
private static void ActionPerformed(ActionListener actionListener) { actionListener.ActionPerformed(new Action(ActionType.WindowMessage)); }
internal virtual void RightClickHere(ActionListener actionListener) { RightClick(); actionListener.ActionPerformed(Action.WindowMessage); }
public WPFStatusBar(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) {}
public SilverlightDocument(AutomationElement automationElement, ActionListener actionListener, InitializeOption initializeOption, WindowSession windowSession) : base(automationElement, actionListener, initializeOption, windowSession) { }
public virtual IUIItem Create(AutomationElement automationElement, ActionListener actionListener) { return new TableHeader(automationElement, actionListener); }
public DateTimePicker(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { }
/// <summary> /// Creates a <code>Timer</code> that will notify its listeners every /// <code>delay</code> milliseconds. /// </summary> public Timer(int @delay, ActionListener @listener) { }
/// <summary> /// Removes the specified action listener from the <code>Timer</code>. /// </summary> public void removeActionListener(ActionListener @listener) { }
public SelectionItem(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { }
public WPFComboBox(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { }
public SilverlightDocument(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { }
public RadioButton(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { }
public PopUpMenu(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { this.actionListener = actionListener; }
public WinFormScrollBars(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener, new DefaultScrollBarButtonAutomationIds(), new DefaultScrollBarButtonAutomationIds()) { }
public virtual void Click(Point point, ActionListener actionListener) { Location = point; Click(); ActionPerformed(actionListener); }
public WPFTreeNode(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { }
public virtual void RightClick(Point point, ActionListener actionListener) { Location = point; RightClickHere(actionListener); }
public TextBox(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { }
public Button(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { toggleableItem = new ToggleableItem(this); }
public ListItems(List <AutomationElement> collection, ActionListener actionListener) : base(collection, actionListener) { this.actionListener = actionListener; }
public virtual void LeaveKey(KeyboardInput.SpecialKeys key, ActionListener actionListener) { SendKeyUp((short)key, true); heldKeys.Remove(key); actionListener.ActionPerformed(Action.WindowMessage); }
public TableColumn(AutomationElement automationElement, ActionListener actionListener, int index) : base(automationElement, actionListener) { this.index = index; }
/// <summary> /// Adds an action listener to the <code>Timer</code>. /// </summary> public void addActionListener(ActionListener @listener) { }
protected Slider(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { uiItemContainer = new UIItemContainer(automationElement, actionListener, InitializeOption.NoCache, new NullWindowSession()); }
public WpfVScrollBar(AutomationElement parent, ActionListener actionListener) : base(parent) { this.actionListener = actionListener; }
public TitleBar(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { automationElementFinder = new AutomationElementFinder(automationElement); }
public TableVerticalScrollBar(AutomationElement automationElement, ActionListener actionListener, TableVerticalScrollOffset offset) : base(automationElement, actionListener) { this.offset = offset; }
public virtual TableRows CreateRows(ActionListener actionListener, TableHeader tableHeader) { List <AutomationElement> rowElements = GetRowElements(); return(new TableRows(rowElements, actionListener, tableHeader, new TableCellFactory(automationElementFinder.AutomationElement, actionListener))); }
public ListViewCells(List <AutomationElement> collection, ActionListener actionListener, ListViewHeader header) : base(collection, new ListViewCellFactory(), actionListener) { this.header = header; }
public WpfDatePicker(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { }
protected CustomUIItem(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener) { }