Exemple #1
0
 public void Dispose()
 {
     StopMagic();
     DockManager.Dispose();
     _activewindowhook.Dispose();
     Unregister();
 }
Exemple #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;
        }
Exemple #3
0
        public override void Dispose()
        {
            base.Dispose();
#if DEBUG
            if (Program.AsyncOperation != null)
            Program.AsyncOperation.Post(state =>
#endif
#if !DEBUG
                    Program.AppContext.AsyncOperation.Post(state =>
#endif
            {
                if (_keyboardHook != null)
                {
                    _keyboardHook.Dispose();
                    _keyboardHook = null;
                }

                if (_activeWindowHook != null)
                {
                    _activeWindowHook.Dispose();
                    _activeWindowHook = null;
                }
            }, null);
        }