public void RemoveById(string id, bool multiple) { if (string.IsNullOrEmpty(id)) { return; } UnityThread.DispatchUnattended(() => { for (int i = notifications.Count - 1; i >= 0; i--) { var notif = notifications[i]; if (notif.Id == id) { notifications.RemoveAt(i); OnRemoveNotification?.Invoke(notif); if (!multiple) { return(null); } } } return(null); }); }
public void Remove(INotification notification) { UnityThread.DispatchUnattended(() => { if (notifications.Remove(notification)) { OnRemoveNotification?.Invoke(notification); } return(null); }); }
/// <summary> /// Event called from notification box when a notification is removed. /// </summary> private void OnNotificationRemoved(INotification notification) { OnRemoveNotification?.Invoke(notification); }