Esempio n. 1
0
 private void StartMagic()
 {
     Debug.Print("MagicArrow: Start");
     var screen = GetScreenFromSide(_movedOutSide);
     _magicTrigger = new MagicTriggerWindow(screen.WorkingArea.Height, _movedOutSide == Side.Left ? WpfScreen.MostLeftX : WpfScreen.MostRightX, screen.WorkingArea.Top, _movedOutSide);
     _magicTrigger.Show();
     _magicTrigger.MouseMove += MagicTriggerOnMouseMove;
     _magicTrigger.MouseLeave += MagicTriggerOnMouseLeave;
     _magicTrigger.MouseDown += MagicTriggerOnMouseDown;
     _activeWindowHook.Enable();
     OnActiveWindowChanged(WindowHelper.GetForegroundWindow());//If the current window is fullscreen, the event wouldn't be raised (because nothing changed)
 }
Esempio n. 2
0
 private void StopMagic()
 {
     if (_magicTrigger != null && _magicTrigger.IsLoaded)
     {
         _magicTrigger.Close();
         _magicTrigger = null;
     }
     _activeWindowHook.Disable();
 }