Created
April 18, 2013 10:08
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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