/// <summary> /// Implements <see cref="IUIItem.Focus"/> /// </summary> public virtual void Focus() { actionListener.ActionPerforming(this); try { automationElement.Focus(); ActionPerformed(); } catch { Logger.Debug("Could not set focus on " + AutomationElement.Display()); } }
public virtual void DoubleClickOutsideToolTip(UIItem uiItem, IActionListener actionListener) { actionListener.ActionPerforming(uiItem); ToolTip toolTip = GetToolTip(uiItem, actionListener); if (toolTip == null) mouse.DoubleClick(uiItem.Bounds.Center(), actionListener); else { logger.Debug("Found tooltip DoubleClicking outside tooltip bounds"); mouse.DoubleClick(toolTip.LeftOutside(uiItem.Bounds), actionListener); } }
private void MakeLastItemReadyForPerformingAction() { if (Count == 0) { return; } ListItem lastItem = Item(Count - 1); if (lastItem.Bounds.IsZeroSize() || string.IsNullOrEmpty(lastItem.Text)) { actionListener.ActionPerforming(lastItem); } }
public virtual void ClickOutsideToolTip(UIItem uiItem, IActionListener actionListener) { actionListener.ActionPerforming(uiItem); ToolTip toolTip = GetToolTip(uiItem, actionListener); if (toolTip == null) { mouse.LeftClick(uiItem.Bounds.Center(), actionListener); } else { logger.Debug("Found tooltip Clicking outside tooltip bounds"); mouse.LeftClick(toolTip.LeftOutside(uiItem.Bounds), actionListener); } }
public virtual void RightClickOutsideToolTip(UIItem uiItem, IActionListener actionListener) { actionListener.ActionPerforming(uiItem); ToolTip toolTip = GetToolTip(uiItem, actionListener); if (toolTip == null) { //Because mouse has already been moved mouse.Click(MouseButton.Right, actionListener); } else { logger.Debug("Found tooltip RightClicking outside tooltip bounds"); mouse.RightClick(toolTip.LeftOutside(uiItem.Bounds), actionListener); } }