public static async Task <bool> ExecuteAsync(NpmCommander commander, NpmCommand command) { using (var runner = new NmpCommandRunner(commander, command)) { return(await runner.command.ExecuteAsync()); } }
private NmpCommandRunner(NpmCommander commander, NpmCommand command) { this._commander = commander; this._command = command; _commander._executingCommand = command; _command.CommandStarted += _commander.command_CommandStarted; _command.OutputLogged += _commander.command_OutputLogged; _command.CommandCompleted += _commander.command_CommandCompleted; _command.ErrorLogged += _commander.command_ErrorLogged; _command.ExceptionLogged += _commander.command_ExceptionLogged; }
private NmpCommandRunner(NpmCommander commander, NpmCommand command) { this.commander = commander; this.command = command; this.commander.executingCommand = command; this.command.CommandStarted += this.commander.command_CommandStarted; this.command.OutputLogged += this.commander.command_OutputLogged; this.command.CommandCompleted += this.commander.command_CommandCompleted; this.command.ErrorLogged += this.commander.command_ErrorLogged; this.command.ExceptionLogged += this.commander.command_ExceptionLogged; }
public static async Task<bool> ExecuteAsync(NpmCommander commander, NpmCommand command) { using (var runner = new NmpCommandRunner(commander, command)) { return await runner._command.ExecuteAsync(); } }