private void VirtualDesktopServiceOnWindowPinned(object sender, WindowPinnedEventArgs e)
 {
     VisualHelper.InvokeOnUIDispatcher(() =>
     {
         this._notificationWindow.Disposable = ShowPinWindow(e.Target, e.PinOperation);
     });
 }
Beispiel #2
0
 private void VirtualDesktopServiceOnRenameCurrent(object sender, RenameEventArgs e)
 {
     VisualHelper.InvokeOnUIDispatcher(() =>
     {
         this._renameWindow.Disposable = ShowRenameWindow();
     });
 }
        private void VirtualDesktopOnCurrentChanged(object sender, VirtualDesktopChangedEventArgs e)
        {
            if (!Settings.General.NotificationWhenSwitchedDesktop)
            {
                return;
            }

            VisualHelper.InvokeOnUIDispatcher(() =>
            {
                var desktops = VirtualDesktop.GetDesktops();
                var newIndex = Array.IndexOf(desktops, e.NewDesktop) + 1;

                this._notificationWindow.Disposable = ShowDesktopWindow(newIndex);
            });
        }
Beispiel #4
0
        private void KeyHookOnPressed(object sender, ShortcutKeyPressedEventArgs args)
        {
            if (args.ShortcutKey == ShortcutKey.None)
            {
                return;
            }

            var target = this._hookActions.FirstOrDefault(x => x.ShortcutKey == args.ShortcutKey);

            if (target != null && target.CanExecute())
            {
                VisualHelper.InvokeOnUIDispatcher(() => target.Action(InteropHelper.GetForegroundWindowEx()));
                args.Handled = true;
            }
        }