示例#1
0
        /// <summary>
        /// Mouse Down event for Middle mouse button
        /// </summary>
        /// <param name="mouseStruct">The mouse parameters</param>
        public void OnMiddleMousedown(MSLLHOOKSTRUCT mouseStruct)
        {
            OnMouse(mouseStruct);

            if (!onScreen)
            {
                return;
            }

            foreach (var guide in Canvas.Children.OfType <Guide>())
            {
                if (guide.OnLeftMouseDown(mousePoint))
                {
                    Canvas.Children.Remove(guide);
                    return;
                }
            }

            ResetAllGuidesActive();

            if (App.Ctrl)
            {
                var guide = new CircleGuide(this, mousePoint);
                Canvas.Children.Add(guide);
            }
            else
            {
                var guide = new LineGuide(this, mousePoint.Y);
                Canvas.Children.Add(guide);
            }
        }
示例#2
0
        void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Topmost = true;
            Cursor  = Cursors.Hand;

            pausedIcon = Imaging.CreateBitmapSourceFromHIcon(Properties.Resources.MainIconPause.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
            normalIcon = Imaging.CreateBitmapSourceFromHIcon(Properties.Resources.MainIcon.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());

#if UPDATE_BLOCK
            updateWatch = new Stopwatch();
            updateWatch.Start();
#endif

#if DEBUG_OVERLAY || DEBUG_CROSS
            screenColor = PickRandomBrush(new Random());
#endif

#if DEBUG_OVERLAY
            debugBoxStartHeight = DebugBox.Height;
#else
            DebugBox.Visibility = Visibility.Hidden;
#endif

#if DEBUG_CROSS
            Canvas.Children.Add(new Rectangle {
                StrokeThickness = 5,
                Stroke          = screenColor,
                Height          = Height,
                Width           = Width
            });

            horiz = new LineGuide(this, 0);
            Canvas.Children.Add(horiz);
            vert = new LineGuide(this, 0);
            Canvas.Children.Add(vert);
            vert.horiz = false;
#endif
        }