Пример #1
0
        private static void AdjustLocation(IList <IHUDItem> results, IHUDItem item, System.Windows.Rect desktopBounds)
        {
            var x         = item.Location.X;
            var y         = item.Location.Y;
            var adjustedY = y;
            var paddingY  = 20d;
            var paddingX  = 6d;

            if (item.Image != null)
            {
                paddingY += Math.Min(item.Image.Height, 32);
                paddingX += Math.Min(item.Image.Width, 32);
            }

            var sorted = results.OrderBy(i => i.Location.Y);

            foreach (var i in sorted)
            {
                if (i.Location.Y - paddingY <= adjustedY && i.Location.Y + paddingY >= adjustedY)
                {
                    if (i.Location.X - paddingX <= x && i.Location.X + paddingX >= x)
                    {
                        adjustedY = i.Location.Y + paddingY;
                    }
                }
            }

            if (adjustedY + paddingY > desktopBounds.Height)
            {
                adjustedY = desktopBounds.Height - paddingY;
            }

            item.Location = new System.Windows.Point(item.Location.X, adjustedY);
        }
Пример #2
0
 public SearchByTextItem(IHUDItem item)
 {
     InternalText = item.InternalText;
     DisplayText  = item.DisplayText;
     Location     = item.Location;
     Bounds       = item.Bounds;
     Image        = item.Image;
 }
Пример #3
0
        public void Invoke(IHUDItem item)
        {
            var center = new Rect(item.Bounds.Center(), new Size(0, 0));

            UIAssistantAPI.ViewAPI.ScaleIndicatorAnimation(center, item.Bounds, false, 250);
            OperationManager.CurrentCommand.Execute(item);

            if (OperationManager.CurrentCommand.IsContinuous)
            {
                OperationManager.CurrentCommand.Next(this);
                return;
            }
            Quit();
        }
Пример #4
0
 public void Execute(IHUDItem item)
 {
     HitaHint.UIAssistantAPI.MouseAPI.MouseOperation.MiddleClick(item.Bounds);
 }
Пример #5
0
 public void Execute(IHUDItem item)
 {
     (item as WidgetInfo).Window.Activate();
 }