Exemplo n.º 1
0
        private async Task <Reminder> NewReminder()
        {
            Reminder createdReminder = await this.CreateReminder();

            // insert the reminder into the database
            StoredProcedures.CreateReminder(createdReminder.Title, createdReminder.ActivateDateAndTime, createdReminder.Description);
            string mainPart    = $"Alright, reminder set for ";
            string datePart    = createdReminder.ActivateDateAndTime.ToString("MMM d");
            string timePart    = createdReminder.ActivateDateAndTime.ToString("h:mm tt");
            string rawSSML     = new SSMLBuilder().Add(mainPart).SayAs(datePart, SSMLBuilder.SayAsTypes.DATE).Add(" at ").SayAs(timePart, SSMLBuilder.SayAsTypes.TIME).BuildWithoutWrapperElement();
            string prosodySSML = new SSMLBuilder().Prosody(rawSSML, pitch: "+5%", contour: "(10%,+5%) (50%,-5%) (80%,-5%)").Build();

            TextToSpeechEngine.SpeakInflectedText(this.MediaElement, prosodySSML);
            return(createdReminder);
        }
Exemplo n.º 2
0
 private void SubmitReminderButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
 {
     if (this.ValidateForm())
     {
         this.PopulateReminderFromForm();
         if (this.ReminderToEdit.ReminderID == -1)
         {
             StoredProcedures.CreateReminder(this.ReminderToEdit.Title, this.ReminderToEdit.ActivateDateAndTime, this.ReminderToEdit.Description);
         }
         else
         {
             StoredProcedures.UpdateReminder(this.ReminderToEdit.ReminderID, this.ReminderToEdit.Title, this.ReminderToEdit.ActivateDateAndTime, this.ReminderToEdit.Description, false);
         }
         UIUtils.GoBack(this, typeof(RemindersPage));
     }
 }
Exemplo n.º 3
0
 private void SubmitReminderButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
 {
     if (this.ValidateForm())
     {
         this.PopulateReminderFromForm();
         if (this.ReminderToEdit.ReminderID == -1)
         {
             StoredProcedures.CreateReminder(this.ReminderToEdit.Title, this.ReminderToEdit.ActivateDateAndTime, this.ReminderToEdit.Description);
             // schedule the notification for it
             AlarmAndReminderHelper.ScheduleReminder(StoredProcedures.QueryLatestReminder());
         }
         else
         {
             StoredProcedures.UpdateReminder(this.ReminderToEdit.ReminderID, this.ReminderToEdit.Title, this.ReminderToEdit.ActivateDateAndTime, this.ReminderToEdit.Description, false);
             // reschedule the reminder
             AlarmAndReminderHelper.RescheduleReminder(this.ReminderToEdit);
         }
         UIUtils.GoBack(this, typeof(RemindersPage));
     }
 }