C# 클래스 NanoByte.Common.Streams.StreamConsumer

Continously reads lines from a StreamReader using a background thread while providing them to a foreground thread on demand.
Useful for processing Process.StandardOutput and Process.StandardError without risking deadlocks.
파일 보기 프로젝트 열기: nano-byte/common 1 사용 예제들

공개 메소드들

메소드 설명
StreamConsumer ( [ reader ) : System

Starts reading from the stream in a background thread.

ToString ( ) : string

Returns all buffered lines that have not been read yet.

WaitForEnd ( ) : void

Waits for StreamReader.EndOfStream.

비공개 메소드들

메소드 설명
ReadLine ( ) : string
ThreadStart ( ) : void

메소드 상세

StreamConsumer() 공개 메소드

Starts reading from the stream in a background thread.
public StreamConsumer ( [ reader ) : System
reader [ The stream to read from.
리턴 System

ToString() 공개 메소드

Returns all buffered lines that have not been read yet.
public ToString ( ) : string
리턴 string

WaitForEnd() 공개 메소드

Waits for StreamReader.EndOfStream.
public WaitForEnd ( ) : void
리턴 void