コード例 #1
0
ファイル: ProcessStreamReader.cs プロジェクト: nickchal/pash
 internal ProcessStreamReader(StreamReader streamReader, string processPath, bool isOutput, PipelineWriter writer, ProcessOutputReader processOutputReader)
 {
     this.streamReader = streamReader;
     this.processPath = processPath;
     this.isOutput = isOutput;
     this.writer = writer;
     this.processOutputReader = processOutputReader;
 }
コード例 #2
0
ファイル: LocalPipeline.cs プロジェクト: modulexcite/pash-1
 private void InitStreams()
 {
     if (this.LocalRunspace.ExecutionContext != null)
     {
         this.oldExternalErrorOutput   = this.LocalRunspace.ExecutionContext.ExternalErrorOutput;
         this.oldExternalSuccessOutput = this.LocalRunspace.ExecutionContext.ExternalSuccessOutput;
         this.LocalRunspace.ExecutionContext.ExternalErrorOutput   = base.ErrorStream.ObjectWriter;
         this.LocalRunspace.ExecutionContext.ExternalSuccessOutput = base.OutputStream.ObjectWriter;
     }
 }
コード例 #3
0
ファイル: pipeline.cs プロジェクト: 40a/PowerShell
        private void Dispose(bool disposing)
        {
            if (_disposed)
                return;

            if (disposing)
            {
                DisposeCommands();
                _localPipeline = null;
                _externalSuccessOutput = null;
                _externalErrorOutput = null;
                _executionScope = null;
                _eventLogBuffer = null;
#if !CORECLR // Impersonation Not Supported On CSS
                SecurityContext.Dispose();
                SecurityContext = null;
#endif
            }

            _disposed = true;
        }
コード例 #4
0
        /// <summary>
        /// Creates an instance of ProcessStreamReader
        /// </summary>
        /// <param name="streamReader">
        /// Stream from which data is read
        /// </param>
        /// <param name="processPath">
        /// Path to the process. This is used for setting the name of the thread.
        /// </param>
        /// <param name="isOutput">
        /// if true stream is output stream of process 
        /// else stream is error stream. 
        /// </param>
        /// <param name="writer">
        /// Processed data is written to it
        /// </param>
        /// <param name="processOutputReader">
        /// ProcessOutputReader which owns this stream reader
        /// </param>
        internal ProcessStreamReader(StreamReader streamReader, string processPath, bool isOutput,
            PipelineWriter writer, ProcessOutputReader processOutputReader)
        {
            Dbg.Assert(streamReader != null, "Caller should validate the parameter");
            Dbg.Assert(processPath != null, "Caller should validate the parameter");
            Dbg.Assert(writer != null, "Caller should validate the parameter");
            Dbg.Assert(processOutputReader != null, "Caller should validate the parameter");

            _streamReader = streamReader;
            _processPath = processPath;
            _isOutput = isOutput;
            _writer = writer;
            _processOutputReader = processOutputReader;
        }
コード例 #5
0
ファイル: LocalPipeline.cs プロジェクト: nickchal/pash
 private void InitStreams()
 {
     if (this.LocalRunspace.ExecutionContext != null)
     {
         this.oldExternalErrorOutput = this.LocalRunspace.ExecutionContext.ExternalErrorOutput;
         this.oldExternalSuccessOutput = this.LocalRunspace.ExecutionContext.ExternalSuccessOutput;
         this.LocalRunspace.ExecutionContext.ExternalErrorOutput = base.ErrorStream.ObjectWriter;
         this.LocalRunspace.ExecutionContext.ExternalSuccessOutput = base.OutputStream.ObjectWriter;
     }
 }
コード例 #6
0
ファイル: PipelineProcessor.cs プロジェクト: nickchal/pash
 private void Dispose(bool disposing)
 {
     if (!this.disposed)
     {
         if (disposing)
         {
             this.DisposeCommands();
             this.localPipeline = null;
             this.externalSuccessOutput = null;
             this.externalErrorOutput = null;
             this.executionScope = null;
             this.SecurityContext.Dispose();
             this.SecurityContext = null;
             this.logBuffer = null;
         }
         this.disposed = true;
     }
 }