Exemple #1
0
 public AlephAction(AlephShortcutScope s, Func <AlephAction, IShortcutHandlerParent, bool> e, string d, ActionModifier m)
 {
     DefaultScope = s; _run = e; Description = d; Modifier = m;
 }
Exemple #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));
        }
 public static T SetActionModifier <T>(this T entity, ActionModifier value)
     where T : RulesetActor
 {
     entity.SetField("actionModifier", value);
     return(entity);
 }
Exemple #4
0
 public AlephAction(Func <AlephAction, MainWindow, bool> e, string d, ActionModifier m)
 {
     _run = e; Description = d; Modifier = m;
 }
Exemple #5
0
        public static void AddCommand(string k, Func <MainWindowViewmodel, ICommand> a, string desc, ActionModifier mod = ActionModifier.None)
        {
            bool Exec(AlephAction src, MainWindow w)
            {
                var vm = w.VM;

                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(Exec, desc, mod));
        }
Exemple #6
0
 public AttachModifierActionArgs(ISource source, THost target, ActionModifier <THost> modifier) : base(source, target)
 {
     Modifier = modifier;
 }