public static Notification Combine(Notification a, Notification b) { if (a.Identifer != b.Identifer) throw new NotSupportedException("Identifers are not the same"); a.Message.AddRange(b.Message); return a; }
public void AddNotification(AlertLevel level, string message, string identifer, NotificationRequest notificationCombiner) { Notification not = new Notification() { AlertLevel = level, Message = new List<string>(new []{message}), Identifer = identifer, DuplicateNotificationRequest = notificationCombiner }; if (m_dicNotifications.ContainsKey(identifer)) m_dicNotifications[identifer] = Notification.Combine(m_dicNotifications[identifer], not); else m_dicNotifications[identifer] = not; }