public void UnRegisterHandler(IDynamicFilteredNotificationHandler <TNotification> handler) { _regLock.Wait(); try { if (this._handlers.Contains(handler)) { this._handlers.Remove(handler); } #if DEBUG else { } #endif } #if DEBUG catch (Exception ex) { Debug.WriteLine($"Error UnRegisterHandler: {ex.Message}"); } #else catch {} #endif finally { _regLock.Release(); } }
public void RegisterHandler(IDynamicFilteredNotificationHandler <TNotification> handler) { #if DEBUG if (handler == null) { return; } #endif _regLock.Wait(); try { #if DEBUG if (handler == null) { return; } #endif if (!this._handlers.Contains(handler)) { this._handlers.Add(handler); } } #if DEBUG catch (Exception ex) { Debug.WriteLine($"Error RegisterHandler: {ex.Message}"); } #else catch {} #endif finally { _regLock.Release(); } }