Example #1
0
 public async Task RunAsync(List <string> cmd, IBaseTerminal term)
 {
     try
     {
         await cmdList[cmd[0]].RunAsync(cmd.Skip(1).ToList(), term).ConfigureAwait(false);
     }
     catch (Exception)
     {
         term.OutputLine("Error in execute the command");
     }
 }
Example #2
0
 public void RunSync(List <string> cmd, IBaseTerminal term)
 {
     try
     {
         cmdList[cmd[0]].RunSync(cmd.Skip(1).ToList(), term);
     }
     catch (Exception)
     {
         term.OutputLine("Error in execute the command");
     }
 }
Example #3
0
 // note: basic actions must be sync
 private void CmdHelpText(List <string> cmd, IBaseTerminal term)
 {
     term.OutputLine("Commands\tDescription");
     // TODO: add another class for format actions.
     // TODO: add mutex for terminal output
     // TODO: next feature add parallel tasks & batch process & task manager
     foreach (var singleCmd in cmdList)
     {
         term.OutputLine(string.Format("{0}\t{1}", singleCmd.Value.CommandText, singleCmd.Value.Description));
     }
 }
Example #4
0
 private void McsList(List <string> cmd, IBaseTerminal term)
 {
     ;
     // TODO: implement this function
 }
Example #5
0
 public async Task RunAsync(List <string> cmd, IBaseTerminal term)
 {
     await Task.Run(() => action(cmd, term)).ConfigureAwait(false);
 }
Example #6
0
 public void RunSync(List <string> cmd, IBaseTerminal term)
 {
     action(cmd, term);
 }