UWP C#Windows 10 IoT闹钟

时间:2017-12-14 02:12:42

标签: c# uwp raspberry-pi3 alarm windows-10-iot-core

我正在尝试编写一个闹钟应用程序,可以设置多个警报以触发Raspberry Pi上的输出引脚。有没有参考项目我可以参考?或 windows 10 alarm&时钟应用参考代码可供参考?

我想了解如何保存单个警报并显示它们。 使用 private void Save_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { var appointment = new Windows.ApplicationModel.Appointments.Appointment(); var recurrence = new Windows.ApplicationModel.Appointments.AppointmentRecurrence(); var scheduleTime = TimePicker.Time; var timeZoneOffset = TimeZoneInfo.Local.GetUtcOffset(DateTime.Now); var startTime = new DateTimeOffset(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, scheduleTime.Hours, scheduleTime.Minutes, 0, timeZoneOffset); appointment.StartTime = startTime; appointment.Duration = TimeSpan.FromMinutes(5); if(dailyAlarm.IsOn == true) { recurrence.Unit = Windows.ApplicationModel.Appointments.AppointmentRecurrenceUnit.Daily; } else { if (setMonday.IsChecked == true) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Monday; } if (setTuesday.IsChecked == true) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Tuesday; } if (setWednesday.IsChecked == true) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Wednesday; } if (setThursday.IsChecked == true) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Thursday; } if (setFriday.IsChecked == true) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Friday; } if (setSaturdayday.IsChecked == true) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Saturday; } if (setSunday.IsChecked == true) { recurrence.DaysOfWeek |= Windows.ApplicationModel.Appointments.AppointmentDaysOfWeek.Sunday; } } } 监控所有报警集? 感谢。

更新: 预期的警报设置如下所示。 alarm setting pivot alarm setting dialog

我创建约会的部分代码如下。但我似乎无法看到任何创建的UWP appointment Sample

bos_report_users

0 个答案:

没有答案