コード例 #1
0
        public static void Execute(IShortcutHandlerParent mw, string key)
        {
            LoggerSingleton.Inst.Trace("ShortcutManager", $"Execute Action [{key}]");

            if (_actions.TryGetValue(key, out var action))
            {
                action.Run(mw);
            }
        }
コード例 #2
0
 public static string GetGestureStr(IShortcutHandlerParent mw, string key)
 {
     if (_actions.ContainsKey(key))
     {
         if (mw.Settings != null && mw.Settings.Shortcuts.TryGetValue(key, out var shortcut))
         {
             return(shortcut.GetGestureStr());
         }
     }
     return(string.Empty);
 }
コード例 #3
0
            public bool Run(IShortcutHandlerParent w)
            {
                if (Modifier.HasFlag(ActionModifier.Disabled))
                {
                    return(false);
                }
                if (Modifier.HasFlag(ActionModifier.DebugOnly) && !AlephAppContext.DebugMode)
                {
                    return(false);
                }
                if (Modifier.HasFlag(ActionModifier.AccessControl) && w.Settings.IsReadOnlyMode)
                {
                    return(false);
                }

                return(_run(this, w));
            }