예제 #1
0
        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);
            });
        }
예제 #2
0
 public void Remove(INotification notification)
 {
     UnityThread.DispatchUnattended(() =>
     {
         if (notifications.Remove(notification))
         {
             OnRemoveNotification?.Invoke(notification);
         }
         return(null);
     });
 }
예제 #3
0
 /// <summary>
 /// Event called from notification box when a notification is removed.
 /// </summary>
 private void OnNotificationRemoved(INotification notification)
 {
     OnRemoveNotification?.Invoke(notification);
 }