public void ScheduleReminderNotifications(ToastNotifier notifier, string userId)
{
foreach (var reminder in Reminders)
{
if (reminder.UserId != userId)
{
continue;
}
var toast = ToastContentFactory.CreateToastText04();
toast.TextHeading.Text = Title;
toast.TextBody2.Text = Location;
var reminderTime = Utilities.UnixTimeStampToDateTime(StartTime - reminder.Interval);
var timeString = IntervalToString(StartDateTime - reminderTime);
toast.TextBody1.Text = timeString;
toast.Duration = ToastDuration.Long;
toast.Audio.Loop = false;
toast.Audio.Content = ToastAudioContent.Reminder;
if (reminderTime < DateTime.Now)
{
continue;
}
var scheduled = new ScheduledToastNotification(toast.CreateNotification().Content, reminderTime);
notifier.AddToSchedule(scheduled);
}
}