public void Dispose() { StopMagic(); DockManager.Dispose(); _activewindowhook.Dispose(); Unregister(); }
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; }
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); }