/// <summary> /// Clear the alerts queue, setting all reminders to -1 /// </summary> public static void ClearQueue() { foreach (Toast each in ToastManager.QueuedToasts) { Reminder reminder = each.Tag as Reminder; if (reminder.ReminderType == ReminderType.Appointment) { AppointmentDatabase.NullifyAlarm(reminder.ID, reminder.EventStartDate.Value); } else if (reminder.ReminderType == ReminderType.Task) { TaskDatabase.NullifyAlarm(reminder.ID); } } ToastManager.QueuedToasts.Clear(); }
private static void alert_Closed(object sender, EventArgs e) { Toast _sender = sender as Toast; Reminder reminder = _sender.Tag as Reminder; //if (_sender.ToastResult != ToastResult.TimedOut) if (reminder.ReminderType == ReminderType.Appointment) { AppointmentDatabase.NullifyAlarm(reminder.ID, reminder.EventStartDate.Value); } else if (reminder.ReminderType == ReminderType.Task) { TaskDatabase.NullifyAlarm(reminder.ID); } Dispatcher.CurrentDispatcher.Invoke(new AlertUpdateEventDelegate(AlertUpdateEvent), new object[] { reminder, _sender.ToastResult == ToastResult.Activated }); }