Ejemplo n.º 1
0
 private void BindRedirectionPipes(
     CommandProcessorBase commandProcessor,
     PipelineProcessor pipeline,
     ExecutionContext context)
 {
     if (this._outputRedirection != null)
     {
         commandProcessor.CommandRuntime.OutputPipe = this._outputRedirection.GetRedirectionPipe(context);
         if (commandProcessor.CommandRuntime.OutputPipe != null && commandProcessor.CommandRuntime.OutputPipe.PipelineProcessor != null)
         {
             pipeline.AddRedirectionPipe(commandProcessor.CommandRuntime.OutputPipe.PipelineProcessor);
         }
     }
     if (this._errorRedirection != null)
     {
         if (this._errorRedirection.Merging)
         {
             commandProcessor.CommandRuntime.MergeMyErrorOutputWithSuccess = true;
         }
         else
         {
             commandProcessor.CommandRuntime.ErrorOutputPipe = this._errorRedirection.GetRedirectionPipe(context);
             if (commandProcessor.CommandRuntime.ErrorOutputPipe == null || commandProcessor.CommandRuntime.ErrorOutputPipe.PipelineProcessor == null)
             {
                 return;
             }
             pipeline.AddRedirectionPipe(commandProcessor.CommandRuntime.ErrorOutputPipe.PipelineProcessor);
         }
     }
     else if (context.ShellFunctionErrorOutputPipe != null)
     {
         commandProcessor.CommandRuntime.ErrorOutputPipe = context.ShellFunctionErrorOutputPipe;
     }
     else
     {
         commandProcessor.CommandRuntime.ErrorOutputPipe.ExternalWriter = context.ExternalErrorOutput;
     }
 }