/// <summary> /// Adds given listener to the collections of notified ones, when new log entries are captured. /// </summary> public static void AddListener(IDebugTraceListener listener) { lock (typeof(DebugLog)) { Listeners.Add(listener); } }
/// <summary> /// Init constructor. /// </summary> public ForwardDebugListener(string name, IDebugTraceListener listener) { Name = name; _listeners = new List<IDebugTraceListener>(); _includes = new List<string>(); _excludes = new List<string>(); AddListener(listener); }
/// <summary> /// Init constructor. /// </summary> public ForwardDebugListener(string name, IDebugTraceListener listener) { Name = name; _listeners = new List <IDebugTraceListener>(); _includes = new List <string>(); _excludes = new List <string>(); AddListener(listener); }
public DebugListenerEventArgs(IDebugTraceListener listener, DebugEntry[] entries) { if (listener == null) throw new ArgumentNullException("listener"); if (entries == null) throw new ArgumentNullException("entries"); Listener = listener; Entries = entries; }
/// <summary> /// Init constructor. /// </summary> public ForwardDebugListener(string name, IDebugTraceListener listener, IEnumerable <string> includes) { Name = name; _listeners = new List <IDebugTraceListener>(); _includes = new List <string>(); _excludes = new List <string>(); AddInclude(includes); AddListener(listener); }
/// <summary> /// Init constructor. /// </summary> public ForwardDebugListener(string name, IDebugTraceListener listener, IEnumerable<string> includes) { Name = name; _listeners = new List<IDebugTraceListener>(); _includes = new List<string>(); _excludes = new List<string>(); AddInclude(includes); AddListener(listener); }
/// <summary> /// Adds a listener to forward it debug log messages. /// </summary> public void AddListener(IDebugTraceListener listener) { if (listener != null) { // to be sure, nothing is debug-printed at the moment lock (typeof(DebugLog)) { _listeners.Add(listener); } } }
/// <summary> /// Init constructor. /// </summary> public DelayingModule(int delay, IDebugTraceListener sourceListener) { if (sourceListener == null) throw new ArgumentNullException("sourceListener"); Delay = delay == Timeout.Infinite ? 0 : delay; if (Delay > 0) _timer = new Timer(TimerCompletedCallback, null, Timeout.Infinite, Timeout.Infinite); _sourceListener = sourceListener; _entries = new List<DebugEntry>(); }
/// <summary> /// Releases specified listener. /// </summary> public static bool RemoveListener(IDebugTraceListener listener) { if (listener != null) { lock (typeof(DebugLog)) { return(Listeners.Remove(listener)); } } return(false); }
public DebugListenerEventArgs(IDebugTraceListener listener, DebugEntry[] entries) { if (listener == null) { throw new ArgumentNullException("listener"); } if (entries == null) { throw new ArgumentNullException("entries"); } Listener = listener; Entries = entries; }
/// <summary> /// Init constructor. /// </summary> public DelayingModule(int delay, IDebugTraceListener sourceListener) { if (sourceListener == null) { throw new ArgumentNullException("sourceListener"); } Delay = delay == Timeout.Infinite ? 0 : delay; if (Delay > 0) { _timer = new Timer(TimerCompletedCallback, null, Timeout.Infinite, Timeout.Infinite); } _sourceListener = sourceListener; _entries = new List <DebugEntry>(); }
/// <summary> /// Releases all resources used by registered debug log listeners. /// </summary> public static void RemoveListeners() { IDebugTraceListener[] copyOfListeners; lock (typeof(DebugLog)) { copyOfListeners = new IDebugTraceListener[Listeners.Count]; Listeners.CopyTo(copyOfListeners, 0); Listeners.Clear(); } foreach (var listener in copyOfListeners) { var disposable = listener as IDisposable; if (disposable != null) { disposable.Dispose(); } } }
/// <summary> /// Releases all resources used by registered debug log listeners. /// </summary> public static void RemoveListeners() { IDebugTraceListener[] copyOfListeners; lock (typeof(DebugLog)) { copyOfListeners = new IDebugTraceListener[Listeners.Count]; Listeners.CopyTo(copyOfListeners, 0); Listeners.Clear(); } foreach (var listener in copyOfListeners) { var disposable = listener as IDisposable; if (disposable != null) disposable.Dispose(); } }
/// <summary> /// Releases specified listener. /// </summary> public static bool RemoveListener(IDebugTraceListener listener) { if (listener != null) { lock (typeof(DebugLog)) { return Listeners.Remove(listener); } } return false; }
/// <summary> /// Adds given listener to the collections of notified ones, when new log entries are captured. /// </summary> public static void AddListener(IDebugTraceListener listener) { lock (typeof(DebugLog)) { Listeners.Add(listener); } }
/// <summary> /// Init constructor. /// </summary> public DelayingModule(IDebugTraceListener sourceListener) : this(DefaultDelay, sourceListener) { }
/// <summary> /// Init constructor. /// </summary> public DelayingModule(IDebugTraceListener sourceListener) : this(DefaultDelay, sourceListener) { }
/// <summary> /// Adds a listener to forward it debug log messages. /// </summary> public void AddListener(IDebugTraceListener listener) { if (listener != null) { // to be sure, nothing is debug-printed at the moment lock (typeof(DebugLog)) { _listeners.Add(listener); } } }