Пример #1
0
 public static ConsoleExecuteResult SaveMacro(string name)
 {
     if (_consoleMacro == null) return new ConsoleExecuteResult("Nothing to save");
     //remove the last command, since that was the 'save' command
     _consoleMacro.RemoveLast();
     var result = _consoleMacro.Save(name);
     _consoleMacro = null;
     return result;
 }
Пример #2
0
        public static ConsoleExecuteResult SaveMacro(string name)
        {
            if (_consoleMacro == null)
            {
                return(new ConsoleExecuteResult("Nothing to save"));
            }
            //remove the last command, since that was the 'save' command
            _consoleMacro.RemoveLast();
            var result = _consoleMacro.Save(name);

            _consoleMacro = null;
            return(result);
        }
Пример #3
0
 public static IEnumerable<ConsoleExecuteResult> RunMacro(string name)
 {
     _consoleMacro = new ConsoleMacro();
     _consoleMacro.Load(name);
     _consoleMacro.Running = true;
     if (_consoleMacro.Count == 0)
     {
         yield return new ConsoleExecuteResult("Macro not found or it contains no commands", new ConsoleExecuteAction(ConsoleExecuteActions.None, null));
     }
     else
     {
         foreach (var command in _consoleMacro.Values.Where(command => !string.IsNullOrWhiteSpace(command)))
         {
             yield return
                 new ConsoleExecuteResult("command",
                     new ConsoleExecuteAction(ConsoleExecuteActions.RunCommand, command));
         }
     }
     _consoleMacro = null;
 }
Пример #4
0
 public static IEnumerable <ConsoleExecuteResult> RunMacro(string name)
 {
     _consoleMacro = new ConsoleMacro();
     _consoleMacro.Load(name);
     _consoleMacro.Running = true;
     if (_consoleMacro.Count == 0)
     {
         yield return(new ConsoleExecuteResult("Macro not found or it contains no commands", new ConsoleExecuteAction(ConsoleExecuteActions.None, null)));
     }
     else
     {
         foreach (var command in _consoleMacro.Values.Where(command => !string.IsNullOrWhiteSpace(command)))
         {
             yield return
                 (new ConsoleExecuteResult("command",
                                           new ConsoleExecuteAction(ConsoleExecuteActions.RunCommand, command)));
         }
     }
     _consoleMacro = null;
 }
Пример #5
0
 public static void StartMacroCapture()
 {
     _consoleMacro = new ConsoleMacro();
 }
Пример #6
0
 public static void CancelMacroCapture()
 {
     _consoleMacro = null;
 }
Пример #7
0
 public static void StartMacroCapture()
 {
     _consoleMacro = new ConsoleMacro();
 }
Пример #8
0
 public static void CancelMacroCapture()
 {
     _consoleMacro = null;
 }