At the moment I write a lot of status messages out using the following:
Debug.Writeline("This is my status message");
I would like to be able to create a method that allows me to either output messages via Debug
or redirect them to a textbox in my UI. However, the Debug and Textbox objects are not compatible. How can I do this in such a way that the caller can use the same message to generate output and let the calling method decide where to send it (i.e., to Debug, the UI, or even a log file)?