/// <summary> /// Attempts to add a notification to the list. /// </summary> /// <param name="notification">Notification instance</param> /// <returns>Process success/failure</returns> public static bool AddNotification(NotificationBase notification) { if (notification != null && !NotificationsList.Contains(notification)) { NotificationsList.Add(notification); UpdateNotifications(); return(true); } return(false); }
/// <summary> /// Attempts to remove the notification from the list. /// </summary> /// <param name="notification">Notifications instance</param> /// <returns>Process success/failure</returns> public static bool RemoveNotification(this NotificationBase notification) { if (NotificationsList.Contains(notification)) { NotificationsList.Remove(notification); UpdateNotifications(); return(true); } return(false); }
/// <summary> /// Verifies the notification validation and checks if the notification is on the notifications list. /// </summary> /// <param name="notification">Notification instance</param> /// <returns>Validates the notification and returns success or failure</returns> public static bool IsValid(this NotificationBase notification) { return(notification != null && NotificationsList.Contains(notification)); }