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"); } }
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"); } }
// 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)); } }
private void McsList(List <string> cmd, IBaseTerminal term) { ; // TODO: implement this function }
public async Task RunAsync(List <string> cmd, IBaseTerminal term) { await Task.Run(() => action(cmd, term)).ConfigureAwait(false); }
public void RunSync(List <string> cmd, IBaseTerminal term) { action(cmd, term); }