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());
 }
 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);
     }
 }
Beispiel #3
0
 public virtual void ClickOutsideToolTip(UIItem uiItem, ActionListener actionListener)
 {
     actionListener.ActionPerforming(uiItem);
     ToolTip toolTip = GetToolTip(uiItem, actionListener);
     if (toolTip == null)
         mouse.Click(uiItem.Bounds.Center(), actionListener);
     else
     {
         logger.Debug("Found tooltip Clicking outside tooltip bounds");
         mouse.Click(toolTip.LeftOutside(uiItem.Bounds), actionListener);
     }
 }
        /// <summary>
        /// Find all the UIItems which belongs to a window and are within (bounds of) another UIItem.
        /// </summary>
        /// <param name="containingItem">Containing item</param>
        /// <returns>List of all the items.</returns>
        public virtual List <UIItem> ItemsWithin(UIItem containingItem)
        {
            UIItemCollection itemsWithin = factory.ItemsWithin(containingItem.Bounds, this);
            var items = new List <UIItem>();

            foreach (var item in itemsWithin)
            {
                if (!item.Equals(containingItem))
                {
                    items.Add((UIItem)item);
                }
            }
            return(items);
        }
        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);
            }
        }
Beispiel #6
0
 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
     {
         logger.Debug("Found tooltip RightClicking outside tooltip bounds");
         mouse.RightClick(toolTip.LeftOutside(uiItem.Bounds), actionListener);
     }
 }
 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 virtual bool IsEditable(UIItem uiItem)
 {
     return editableControls.IsAssignableFrom(uiItem.GetType());
 }
Beispiel #9
0
 public virtual void SetValueOn(UIItem uiItem)
 {
     object value = fieldInfo.GetValue(entity);
     if (null != value) uiItem.SetValue(value);
 }
 public CustomCommandInterceptor(UIItem uiItem)
 {
     if (uiItem == null) throw new ArgumentNullException();
     this.uiItem = uiItem;
 }
 public SettingsWindow(Application application, Window whiteWindow, UIItem settingsControl)
     : base(application, whiteWindow)
 {
     this.settingsControl = settingsControl;
 }
Beispiel #12
0
 public static void LogProperties(UIItem uiItem)
 {
     LogProperties(uiItem.AutomationElement);
 }
 public ToggleableItem(UIItem uiItem)
     : base(uiItem.AutomationElement, uiItem.ActionListener)
 {
 }
 public virtual void Accept(UIItem uiItem)
 {
     if (strategy.Reject(uiItem)) return;
     dynamicScreenClass.Add(strategy.FieldName(uiItem), uiItem.GetType());
 }
Beispiel #15
0
 public static void LogPatterns(UIItem uiItem)
 {
     LogPatterns(uiItem.AutomationElement);
 }
Beispiel #16
0
        /// <summary>
        /// Find all the UIItems which belongs to a window and are within (bounds of) another UIItem.
        /// </summary>
        /// <param name="containingItem">Containing item</param>
        /// <returns>List of all the items.</returns>
        public virtual List <UIItem> ItemsWithin(UIItem containingItem)
        {
            UIItemCollection itemsWithin = factory.ItemsWithin(containingItem.Bounds, this);

            return(itemsWithin.Where(item => !item.Equals(containingItem)).Cast <UIItem>().ToList());
        }
 public virtual bool IsEditable(UIItem uiItem)
 {
     return editableControls.All(t=>t.IsInstanceOfType(uiItem));
 }
Beispiel #18
0
 public override void ActionPerforming(UIItem uiItem)
 {
     new ScreenItem(uiItem, ScrollBars).MakeVisible(this);
 }
Beispiel #19
0
 public override void ActionPerforming(UIItem uiItem)
 {
     new ScreenItem(uiItem, ScrollBars).MakeVisible(this);
 }
 public virtual void Accept(UIItem uiItem)
 {
     uiItem.HookEvents(this);
 }
Beispiel #21
0
 public ToggleableItem(UIItem uiItem) : base(uiItem.AutomationElement, uiItem.ActionListener)
 {
 }
Beispiel #22
0
 public virtual void DragHorizontally(UIItem uiItem, int distance)
 {
     Location = uiItem.Bounds.Center();
     double currentXLocation = Location.X;
     double currentYLocation = Location.Y;
     HoldForDrag();
     ActionPerformed(uiItem);
     Location = new Point(currentXLocation + distance, currentYLocation);
     LeftUp();
 }
Beispiel #23
0
 public virtual ToolTip GetToolTipOn(UIItem uiItem)
 {
     Mouse.Location = uiItem.Bounds.Center();
     uiItem.Focus();
     return(ToolTip);
 }
Beispiel #24
0
 public virtual void ActionPerforming(UIItem uiItem)
 {
 }
 public virtual void Accept(UIItem uiItem)
 {
     try { uiItem.UnHookEvents();} catch {}
 }
Beispiel #26
0
 public virtual void Drop(UIItem uiItem)
 {
     Mouse.DragAndDrop(uiItem, IconsList);
 }
Beispiel #27
0
 public virtual void DragVertically(UIItem uiItem, int distance)
 {
     Location = uiItem.Location;
     double currentXLocation = Location.X;
     double currentYLocation = Location.Y;
     HoldForDrag();
     ActionPerformed(uiItem);
     Location = new Point(currentXLocation, currentYLocation + distance);
     LeftUp();
 }
Beispiel #28
0
 public virtual void ActionPerforming(UIItem uiItem)
 {
 }