예제 #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>);
 }