コード例 #1
0
        private string Map(Dictionary <string, string> args)
        {
            string key   = args["map"];
            string mode  = args["mode"];
            string macro = args["macro"];

            MapResolver.Map(mode, key, macro);

            return("");
        }
コード例 #2
0
        private void ExecuteMacro(object sender, ExecutedRoutedEventArgs args)
        {
            string macro = args.Parameter as string;
            int    count = Count ?? 1;

            this.count = null;

            for (; count > 0; count -= 1)
            {
                foreach (var action in MapResolver.ResolveMacro(currentMode, macro))
                {
                    action(this);
                }
            }
        }
コード例 #3
0
        private void RevertMode()
        {
            defaultInsert = currentMode.DefaultInsert;

            InputBindings.Clear();

            foreach (var ghp in currentMode.Gestures)
            {
                InputBindings.Add(
                    new InputBinding(EditingCommands.HandleKey, ghp.Key)
                {
                    CommandParameter = ghp.Value
                });
            }
            if (MapResolver.HasMacros(currentMode))
            {
                foreach (var ghp in MapResolver.GetMacros(currentMode))
                {
                    BindMacro(ghp.Key, ghp.Value);
                }
            }
        }