Ejemplo n.º 1
0
		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, (FileStream) error_stream.BaseStream, false);
				async_error.BeginReadLine ();
			}
		}
Ejemplo n.º 2
0
		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, (FileStream) output_stream.BaseStream, true);
				async_output.BeginReadLine ();
			}
		}