private TraceObject() { liteSwitch = new LiteSwitch(); if (liteSwitch.Attributes.ContainsKey("listener")) { string listenerName = liteSwitch.Attributes["listener"]; foreach (TraceListener tl in Trace.Listeners) { if (tl.Name == listenerName) { listener = tl; break; } } if (listener != null && liteSwitch.Attributes.ContainsKey("dedicated")) { string dedicated = liteSwitch.Attributes["dedicated"]; if (dedicated == "true") Trace.Listeners.Remove(listener); } } }
private TraceObject() { liteSwitch = new LiteSwitch(); if (liteSwitch.Attributes.ContainsKey("listener")) { string listenerName = liteSwitch.Attributes["listener"]; foreach (TraceListener tl in Trace.Listeners) { if (tl.Name == listenerName) { listener = tl; break; } } if (listener != null && liteSwitch.Attributes.ContainsKey("dedicated")) { string dedicated = liteSwitch.Attributes["dedicated"]; if (dedicated == "true") { Trace.Listeners.Remove(listener); } } } }