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);
     }
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 4
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);
            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);
            }
        }
Exemplo n.º 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());
 }
Exemplo n.º 9
0
 public virtual void SetValueOn(UIItem uiItem)
 {
     object value = fieldInfo.GetValue(entity);
     if (null != value) uiItem.SetValue(value);
 }
Exemplo n.º 10
0
 public CustomCommandInterceptor(UIItem uiItem)
 {
     if (uiItem == null) throw new ArgumentNullException();
     this.uiItem = uiItem;
 }
Exemplo n.º 11
0
 public SettingsWindow(Application application, Window whiteWindow, UIItem settingsControl)
     : base(application, whiteWindow)
 {
     this.settingsControl = settingsControl;
 }
Exemplo n.º 12
0
Arquivo: Debug.cs Projeto: ritro/White
 public static void LogProperties(UIItem uiItem)
 {
     LogProperties(uiItem.AutomationElement);
 }
Exemplo n.º 13
0
 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());
 }
Exemplo n.º 15
0
Arquivo: Debug.cs Projeto: ritro/White
 public static void LogPatterns(UIItem uiItem)
 {
     LogPatterns(uiItem.AutomationElement);
 }
Exemplo n.º 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());
        }
Exemplo n.º 17
0
 public virtual bool IsEditable(UIItem uiItem)
 {
     return editableControls.All(t=>t.IsInstanceOfType(uiItem));
 }
Exemplo n.º 18
0
 public override void ActionPerforming(UIItem uiItem)
 {
     new ScreenItem(uiItem, ScrollBars).MakeVisible(this);
 }
Exemplo n.º 19
0
 public override void ActionPerforming(UIItem uiItem)
 {
     new ScreenItem(uiItem, ScrollBars).MakeVisible(this);
 }
Exemplo n.º 20
0
 public virtual void Accept(UIItem uiItem)
 {
     uiItem.HookEvents(this);
 }
Exemplo n.º 21
0
 public ToggleableItem(UIItem uiItem) : base(uiItem.AutomationElement, uiItem.ActionListener)
 {
 }
Exemplo n.º 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();
 }
Exemplo n.º 23
0
 public virtual ToolTip GetToolTipOn(UIItem uiItem)
 {
     Mouse.Location = uiItem.Bounds.Center();
     uiItem.Focus();
     return(ToolTip);
 }
Exemplo n.º 24
0
 public virtual void ActionPerforming(UIItem uiItem)
 {
 }
Exemplo n.º 25
0
 public virtual void Accept(UIItem uiItem)
 {
     try { uiItem.UnHookEvents();} catch {}
 }
Exemplo n.º 26
0
 public virtual void Drop(UIItem uiItem)
 {
     Mouse.DragAndDrop(uiItem, IconsList);
 }
Exemplo n.º 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();
 }
Exemplo n.º 28
0
 public virtual void ActionPerforming(UIItem uiItem)
 {
 }