title: Check if output is redirected
body: <p>I have a console application written in C# which processes some data then prints the results. Until the results are available there is a little animation ( / - \ | ) and progress percentage ( xx% ) which is constantly updating.</p>
  
  <p>Obviously if the user redirects the output of my application this will be printed to the text file where output is redirected to. If possible I would like to avoid this.</p>
  
  <p>So is there a way to detect if the output of my application is redirected? 
  I am considering only showing the progress indicators when run with a specified parameter, but I'm hoping someone will have a good answer for me.</p>