public State() { // Inject a trace listener for debug or trace messages. debugTraceListener = new ContextualLogTraceListener(MarkupStreamNames.DebugTrace); Trace.Listeners.Add(debugTraceListener); Trace.AutoFlush = true; }
public void Dispose() { // Remove trace listener. if (debugTraceListener != null) { Trace.Listeners.Remove(debugTraceListener); debugTraceListener = null; } }