Inheritance: BasicLaunchInfo
Ejemplo n.º 1
0
 public Task<ProcessExitResult> LaunchAndProcessAsync(LaunchAndProcessInfo info) {
     Contract.Requires<ArgumentNullException>(info != null);
     return default(Task<ProcessExitResult>);
 }
Ejemplo n.º 2
0
 static IDisposable SetupStandardOutput(LaunchAndProcessInfo info, ReactiveProcess process) {
     if (!info.StartInfo.RedirectStandardOutput)
         throw new InvalidOperationException("Not redirected output");
     var dsp = new CompositeDisposable();
     if (info.StandardOutputObs != null)
         dsp.Add(info.StandardOutputObs(process.StandardOutputObservable));
     if (info.StandardOutputAction != null)
         dsp.Add(process.StandardOutputObservable.Subscribe(data => info.StandardOutputAction(process, data)));
     return dsp;
 }
Ejemplo n.º 3
0
 public ProcessExitResult LaunchAndProcess(LaunchAndProcessInfo info)
     => LaunchAndProcessAsync(info).WaitAndUnwrapException();
Ejemplo n.º 4
0
 public async Task<ProcessExitResult> LaunchAndProcessAsync(LaunchAndProcessInfo info) {
     using (var process = new ReactiveProcess {StartInfo = info.StartInfo.EnableRedirect()}) {
         using (SetupStandardOutput(info, process))
         using (SetupStandardError(info, process))
             return
                 await
                     LaunchAndWaitForExitAsync(process, info.MonitorOutput, info.MonitorResponding,
                             info.CancellationToken)
                         .ConfigureAwait(false);
     }
 }