Skip to content

Instantly share code, notes, and snippets.

@Konard
Created April 18, 2013 10:08
Show Gist options
  • Save Konard/5411629 to your computer and use it in GitHub Desktop.
Save Konard/5411629 to your computer and use it in GitHub Desktop.
ProcessExtensions is a class that contains extension-methods for System.Diagnostics.Process class.
using System;
using System.Diagnostics;
namespace Konard.Helpers
{
public static class ProcessExtensions
{
static public void AllowDirectControlThroughParentProcess(this Process childProcess)
{
childProcess.StartInfo.UseShellExecute = false;
}
static public void AllowReadingOfStandardOutputFromChildProcess(this Process childProcess)
{
childProcess.StartInfo.RedirectStandardOutput = true;
childProcess.StartInfo.StandardOutputEncoding = Console.OutputEncoding;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment