public void Report(string message, string shortDescription = null, string longDescription = null) { var key = new Key(message, shortDescription, longDescription); var value = GetValue(key); var currentTime = _timeService.UtcTime; if (value == null) { var notification = new Notification(currentTime, message, shortDescription, longDescription); value = new NotificationWithLastTime(notification, currentTime); AddValue(key, value); } else { value.LastTime = currentTime; } ContainsActiveNotifications = true; }
private void AddValue(Key key, NotificationWithLastTime item) { _notificationDic.Add(key, item); _dispatcherService.Invoke(() => _notificationList.Add(item.Notification)); }