public WindowSelectorTool() { InitializeComponent(); m = new MouseHook(); BorderContainer.ItemsSource = borderCollectionSource; currentBorder = new AnnoyingRectangle(); borderCollectionSource.Add(currentBorder); }
private void m_MouseDown(object sender, MouseHookEventArgs e) { lastMouseDownHandled = false; if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) { currentBorder.Background = new LinearGradientBrush( Color.FromArgb(20, 255, 0, 0), Color.FromArgb(20, 255, 0, 0), 90.0); currentBorder = new AnnoyingRectangle(); borderCollectionSource.Add(currentBorder); e.Handled = lastMouseDownHandled = true; } }
private void m_MouseDown(object sender, MouseHookEventArgs e) { if (Keyboard.IsKeyDown(Key.LeftAlt)) return; e.Handled = true; _isMoving = true; _currentBorder = new AnnoyingRectangle(); _currentBorder.Background = new LinearGradientBrush( Color.FromArgb(80, 255, 0, 0), Color.FromArgb(80, 255, 0, 0), 90.0); _borderCollectionSource.Add(_currentBorder); e.Handled = _lastMouseDownHandled = true; Down = new Point(e.X, e.Y); }
protected bool Equals(AnnoyingRectangle other) { return _Width == other._Width && _Height == other._Height && _X == other._X && _Y == other._Y; }