public ObservableShortcutConfig(string id, string d, AlephKey k, AlephModifierKeys m, AlephShortcutScope s)
 {
     _identifier  = id;
     _description = d;
     _key         = k;
     _modifiers   = m;
     _scope       = s;
 }
Esempio n. 2
0
        private static void AddCommand(AlephShortcutScope scope, string k, Func <IShortcutHandler, ICommand> a, string desc, ActionModifier mod = ActionModifier.None)
        {
            bool Exec(AlephAction src, IShortcutHandlerParent w)
            {
                var vm = w.GetShortcutHandler();

                if (vm == null)
                {
                    return(false);
                }

                var c = a(vm);

                if (!c.CanExecute(null))
                {
                    return(false);
                }

                c.Execute(null);
                return(true);
            }

            _actions.Add(k, new AlephAction(scope, Exec, desc, mod));
        }
Esempio n. 3
0
 public ShortcutDefinition(AlephShortcutScope s, AlephModifierKeys m, AlephKey k)
 {
     Scope     = s;
     Modifiers = m;
     Key       = k;
 }
Esempio n. 4
0
 public AlephAction(AlephShortcutScope s, Func <AlephAction, IShortcutHandlerParent, bool> e, string d, ActionModifier m)
 {
     DefaultScope = s; _run = e; Description = d; Modifier = m;
 }