Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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;
     }
 }
Ejemplo n.º 3
0
        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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 5
0
 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;
     }
 }
Ejemplo n.º 6
0
 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;
     }
 }