Exemple #1
0
 private void OnSaveHotKey(
     IApplicationWindow applicationWindow,
     HotKeyService service,
     HotKeyEvents.SaveGetFocusHotKeyArgs args)
 {
     service.Stop();
     service.Remove(BringToFocusEventName);
     service.Add(BringToFocusEventName, args.Modifiers, args.Keys, () => this.BringToFocus(applicationWindow));
     if (args.IsEnabled)
     {
         service.Start();
     }
 }
Exemple #2
0
        private void SetUpHotKeyService(
            IApplicationWindow applicationWindow,
            HotKeyService service,
            IHotKeySettings settings)
        {
            var isEnabled = settings.GetIsHotKeyEnabled();
            var modifiers = settings.GetModifier();
            var keys      = settings.GetKeys();

            service.Add(BringToFocusEventName, modifiers, keys, () => this.BringToFocus(applicationWindow));
            if (isEnabled)
            {
                service.Start();
            }
        }