public TraceHook(TraceSource source) { this.listener = new PassThruListener(); this.collection = source.Listeners; this.lockContext = new object(); source.Listeners.Add(listener); HookupListener(); }
public void Dispose() { lock (lockContext) { if (listener != null) { collection.Remove(listener); listener = null; } } }