Beispiel #1
0
        public void Remove(Notification notification)
        {
            _container.Remove(notification);

            if (_container.Count == 0)
            {
                CountBeforeReset = 0;
            }
        }
Beispiel #2
0
        private void CheckForNotifications(object sender, EventArgs eventArgs)
        {
            if (IsNewDay())
            {
                // Clear any notifications that may have been dismissed. Allow them to alert again today.
                _notificationQueue.Clear();
            }

            foreach (Task task in _MainWindowViewModel.Tasks)
            {
                if (task.DueDate.Date == DateTime.Today)
                {
                    Notification notification = new Notification(
                        "A task is due today\n" + task.Key + " " + task.Description,
                        new OpenTaskCommand(task) as ITaskDashCommand,
                        new DelayTaskCommand(task) as ITaskDashCommand
                            );
                    
                    ShowPopup(notification);
                }
            }
        }
 public RemoveNotificationCommand(Notification notification, NotificationList notifications)
 {
     _notifications = notifications;
     _notification = notification;
 }
Beispiel #4
0
        private bool CheckEquals(Notification other)
        {
            bool equalLength = Equals(other._delayLength, _delayLength);
            bool equalButtonPresses = other._dismissButtonPressed.Equals(_dismissButtonPressed);
            bool equalDescriptions = Equals(other.Description, Description);
            bool equalDelay = other.DelayTime.Equals(DelayTime);

            return equalLength
                   && equalButtonPresses
                   && equalDescriptions
                   && equalDelay;
        }
Beispiel #5
0
        public bool Equals(Notification other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;

            bool equal = CheckEquals(other);

            return equal;
        }
Beispiel #6
0
        public void Add(Notification notification)
        {
            _container.Add(notification);

            CountBeforeReset++;
        }
Beispiel #7
0
 private void ShowPopup(Notification notification)
 {
     _notificationQueue.Enqueue(notification);
 }