internal void Start(string commandText) { _command = _remoteSystem.CreateStreamableCommand(commandText); _remoteSystem.StartCommand(_command, Timeout.InfiniteTimeSpan); _command.Finished += (sender, e) => _callback.OnExit(((NonHostedCommand)sender).ExitCode.ToString(CultureInfo.InvariantCulture)); _command.OutputReceived += (sender, e) => _callback.OnOutputLine(e.Output); _command.RedirectErrorOutputToOutput = true; _command.BeginOutputRead(); }
private void Close() { lock (_lock) { if (_command != null) { _command.Dispose(); _command = null; } } }