Пример #1
0
 public ProcessExitResultWithOutput LaunchAndGrab(BasicLaunchInfo info) {
     var outputBuilder = new StringBuilder();
     var errorBuilder = new StringBuilder();
     var outInfo = LaunchAndProcess(new LaunchAndProcessInfo(info.StartInfo.EnableRedirect()) {
         StandardOutputAction = (process, data) => outputBuilder.AppendLine(data),
         StandardErrorAction = (process, data) => errorBuilder.AppendLine(data),
         MonitorOutput = info.MonitorOutput,
         MonitorResponding = info.MonitorResponding
     });
     return new ProcessExitResultWithOutput(outInfo.ExitCode, outInfo.Id, info.StartInfo,
         outputBuilder.ToString(),
         errorBuilder.ToString());
 }
Пример #2
0
 public ProcessExitResult Launch(BasicLaunchInfo info) {
     using (var process = new Process {StartInfo = info.StartInfo}) {
         LaunchAndWaitForExit(process, info.MonitorOutput, info.MonitorResponding);
         return new ProcessExitResult(process.ExitCode, process.Id, info.StartInfo);
     }
 }
Пример #3
0
 public abstract Process Launch(BasicLaunchInfo info);
Пример #4
0
 public async Task<ProcessExitResult> LaunchAsync(BasicLaunchInfo info) {
     using (var process = new ReactiveProcess {StartInfo = info.StartInfo}) {
         return
             await
                 LaunchAndWaitForExitAsync(process, info.MonitorOutput, info.MonitorResponding,
                     info.CancellationToken)
                     .ConfigureAwait(false);
     }
 }
Пример #5
0
 public Task<ProcessExitResultWithOutput> LaunchAndGrabAsync(BasicLaunchInfo info) {
     Contract.Requires<ArgumentNullException>(info != null);
     return default(Task<ProcessExitResultWithOutput>);
 }