public void BeginErrorReadLine () { if (process_handle == IntPtr.Zero || error_stream == null || StartInfo.RedirectStandardError == false) throw new InvalidOperationException ("Standard error has not been redirected or process has not been started."); if ((async_mode & AsyncModes.SyncError) != 0) throw new InvalidOperationException ("Cannot mix asynchronous and synchonous reads."); async_mode |= AsyncModes.AsyncError; error_canceled = false; if (async_error == null) { async_error = new ProcessAsyncReader (this, stderr_rd, false); async_error.ReadHandler.BeginInvoke (null, async_error); } }
public void BeginOutputReadLine () { if (process_handle == IntPtr.Zero || output_stream == null || StartInfo.RedirectStandardOutput == false) throw new InvalidOperationException ("Standard output has not been redirected or process has not been started."); if ((async_mode & AsyncModes.SyncOutput) != 0) throw new InvalidOperationException ("Cannot mix asynchronous and synchonous reads."); async_mode |= AsyncModes.AsyncOutput; output_canceled = false; if (async_output == null) { async_output = new ProcessAsyncReader (this, stdout_rd, true); async_output.ReadHandler.BeginInvoke (null, async_output); } }
public void BeginErrorReadLine () { if (process_handle == IntPtr.Zero || error_stream == null || StartInfo.RedirectStandardError == false) throw new InvalidOperationException ("Standard error has not been redirected or process has not been started."); if ((async_mode & AsyncModes.SyncError) != 0) throw new InvalidOperationException ("Cannot mix asynchronous and synchonous reads."); async_mode |= AsyncModes.AsyncError; if (async_error == null) async_error = new AsyncStreamReader (this, error_stream.BaseStream, new UserCallBack(this.ErrorReadNotifyUser), error_stream.CurrentEncoding); async_error.BeginReadLine (); }
public void CancelErrorRead () { if (process_handle == IntPtr.Zero || error_stream == null || StartInfo.RedirectStandardError == false) throw new InvalidOperationException ("Standard error has not been redirected or process has not been started."); if ((async_mode & AsyncModes.SyncOutput) != 0) throw new InvalidOperationException ("OutputStream is not enabled for asynchronous read operations."); if (async_error == null) throw new InvalidOperationException ("No async operation in progress."); async_error.CancelOperation (); async_mode &= ~AsyncModes.AsyncError; }
public void BeginOutputReadLine () { if (process_handle == IntPtr.Zero || output_stream == null || StartInfo.RedirectStandardOutput == false) throw new InvalidOperationException ("Standard output has not been redirected or process has not been started."); if ((async_mode & AsyncModes.SyncOutput) != 0) throw new InvalidOperationException ("Cannot mix asynchronous and synchonous reads."); if ((async_mode & AsyncModes.AsyncOutput) != 0) throw new InvalidOperationException ("An async read operation has already been started on the stream."); async_mode |= AsyncModes.AsyncOutput; if (async_output == null) async_output = new AsyncStreamReader (this, output_stream.BaseStream, new UserCallBack(this.OutputReadNotifyUser), output_stream.CurrentEncoding); async_output.BeginReadLine (); }