That article talks about printing the contents of a RichTextBox to an output device. This isn't what I'm trying to do.
I'm trying to use a StreamWriter (or something similar) to write TO a RichTextBox's richTextBox.Text field. I do not want to use richTextBox.AppendText().
I'm trying to make the output transparent to my worker class. It will not know what it's printing to, just that it's sending output. My reason for this is I want my application to be able to run in a console window if arguments are passed in, or in a winform if there are no arguments.
In the case where there ARE arguments, the worker class will get its inputs from the command line and will send its outputs to the Console output.
In the case where there are NO arguments, the worker class will get its inputs from the WinForm, and will send its outputs to the Winform's RichTextBox.
I wanted to know if there's a type of object I can use for outputting to both the Console and a RichTextBox. This is why I was asking about writing to a RichTextBox with a StreamWriter. Is this possible? If not, is there another type of object that will allow both output to the Console and to a RichTextBox?
Thanks