public void BeginOutputReadLine() { if (outputStreamReadMode == Process2.StreamReadMode.undefined) { outputStreamReadMode = Process2.StreamReadMode.asyncMode; } else { if (outputStreamReadMode != Process2.StreamReadMode.asyncMode) { throw new InvalidOperationException("CantMixSyncAsyncOperation"); } } if (pendingOutputRead) { throw new InvalidOperationException("PendingAsyncOperation"); } pendingOutputRead = true; if (output == null) { if (standardOutput == null) { throw new InvalidOperationException("CantGetStandardOut"); } Stream baseStream = standardOutput.BaseStream; output = new AsyncStreamReader(this, baseStream, new UserCallBack(OutputReadNotifyUser), standardOutput.CurrentEncoding); } output.BeginReadLine(); }