Cs-Script & System.Diagnostics.Debug : Overriding Debug output traces?

For that, you can create a custom TraceListener.

You should set the compile time DEBUG symbol or run the script with /dbg option cscs /dbg You will also need to create a custom TraceListener or simply use a trace viewer like the sysinternals DebugView.

I use the TraceListener for this also, but here's my code snippets: Classes: using System. Diagnostics; public class DebugOutputListener : TraceListener { public event EventHandler DebugMessage; public override void Write(string message) { EventHandler h = DebugMessage; if (h! = null) { DebugArgs args = new DebugArgs { Message = message }; h(this, args); } } public override void WriteLine(string message) { Write(message + "\r\n"); } } public class DebugMessageArgs : EventArgs { public string Message { get; set; } } To receive debug messages, instantiate an instance of the DebugOutputListener, subscribe to the DebugMessage event handler and register the listener with the Debug.

Listeners collection. E.g. Private void InitialiseDebugListener() { DebugListener dl = new DebugListener(); dl.

DebugMessage += new EventHandler(Console_OnDebugMessage); Debug.Listeners. Add(dl); } private void Console_OnDebugMessage(object sender, DebugMessageArgs e) { string debugMessage = e. Message; // Do what you want with debugMessage.

// Be aware this may not come in on the application/form thread. }.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions