Пример #1
0
 public MagicArrowService(Window window)
 {
     BaseWindow = window;
     Application.Current.Deactivated += Application_Deactivated;
     DockManager = new DockManager(window, DockingSide.Left);
     _activeWindowHook = new ActiveWindowHook();
     _activeWindowHook.ActiveWindowChanged += ActiveWindowHook_ActiveWindowChanged;
     _magicArrowCheckTimer = new DispatcherTimer{Interval = TimeSpan.FromSeconds(1)};
     _magicArrowCheckTimer.Tick += MagicArrowCheckTimer_Tick;
 }
Пример #2
0
        public virtual void Dispose(bool disposing)
        {
            if (_disposed)
            {
                Debug.Print("MagicArrow already disposed!");
                return;
            }

            if (disposing)
            {
                StopMagic();
                Application.Current.Deactivated -= Application_Deactivated;
                _activeWindowHook.Dispose();
                DockManager.DragStop();
                // free managed resources
            }
            // free native resources if there are any.
            _disposed = true;
        }