Exemple #1
0
        /// <summary>
        /// Check pending list for expired notifications, when in queue mode.
        /// </summary>
        protected virtual void Update()
        {
            if ((mode & OperatingMode.Queue) != OperatingMode.Queue)
            {
                return;
            }

            // Check each pending notification for expiry, then remove it
            for (int i = PendingNotifications.Count - 1; i >= 0; --i)
            {
                PendingNotification queuedNotification = PendingNotifications[i];
                DateTime?           time = queuedNotification.Notification.DeliveryTime;
                if (time != null && time < DateTime.Now)
                {
                    PendingNotifications.RemoveAt(i);
                    LocalNotificationExpired?.Invoke(queuedNotification);
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Check pending list for expired notifications, when in queue mode.
        /// </summary>

        public override void OnUpdate(float deltaTime)
        {
            base.OnUpdate(deltaTime);

            if (PendingNotifications == null || !PendingNotifications.Any() ||
                (mode & OperatingMode.Queue) != OperatingMode.Queue)
            {
                return;
            }

            // Check each pending notification for expiry, then remove it
            for (int i = PendingNotifications.Count - 1; i >= 0; --i)
            {
                PendingNotification queuedNotification = PendingNotifications[i];
                DateTime?           time = queuedNotification.Notification.DeliveryTime;
                if (time != null && time < DateTime.Now)
                {
                    PendingNotifications.RemoveAt(i);
                    LocalNotificationExpired?.Invoke(queuedNotification);
                }
            }
        }