Beispiel #1
0
 protected override void OnClosed(EventArgs e)
 {
     try
     {
         var n = _notifyIcon;
         _notifyIcon = null;
         n.Dispose();
     }
     finally
     {
         ClipboardMonitor.Stop();
         base.OnClosed(e);
     }
 }
Beispiel #2
0
        protected override void OnSourceInitialized(EventArgs e)
        {
            base.OnSourceInitialized(e);
            ClipboardMonitor.Initialize(this);
            HotkeyManager.Initialize(this);

            HotkeyManager.RegisterHotKey(Key.C, () =>
            {
                if (WindowState == WindowState.Minimized)
                {
                    WindowState = _lastNonMinimizedState;
                }

                if (!IsVisible)
                {
                    Show();
                }

                Topmost = true;
            }, altMod: true);
        }