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;
 }
Beispiel #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);
        }
 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;
 }
Beispiel #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;
 }
 public static void StartMacroCapture()
 {
     _consoleMacro = new ConsoleMacro();
 }
 public static void CancelMacroCapture()
 {
     _consoleMacro = null;
 }
Beispiel #7
0
 public static void StartMacroCapture()
 {
     _consoleMacro = new ConsoleMacro();
 }
Beispiel #8
0
 public static void CancelMacroCapture()
 {
     _consoleMacro = null;
 }