I\'ve some library code that is used by both console and WPF apps. In the library code, there are some Console.Read() calls. I only want to do those input rea
Console.Read()
if (Environment.UserInteractive) { // A console is opened }
See: http://msdn.microsoft.com/en-us/library/system.environment.userinteractive(v=vs.110).aspx
Gets a value indicating whether the current process is running in user interactive mode.