Windows Phone 7.1 SDK 警报
我正在尝试使用 Windows Phone 7.1 SDK 中的新 Alarm 类创建一个闹钟,
我可以让它工作,但闹钟在我设置的时间似乎没有响起。
Alarm alarm = new Alarm("MyAlarm")
{
Content = "Alarm!",
BeginTime = DateTime.Now.AddSeconds(seconds),
};
ScheduledActionService.Add(alarm);
I'm trying to create an alarm using the new Alarm class in the Windows Phone 7.1 SDK
I'm able to get it to work but the alarm doesn't seem to be going off at the time i've set.
Alarm alarm = new Alarm("MyAlarm")
{
Content = "Alarm!",
BeginTime = DateTime.Now.AddSeconds(seconds),
};
ScheduledActionService.Add(alarm);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
中的注释MSDN 说
(强调我的)
不能保证警报在指定的确切秒被调用。我预计警报有可能在指定时间之后几秒钟内触发,但不会在此之前触发。
The remarks in MSDN say
(emphasis mine)
There is no guarantee on the alarm being called at the exact second specified. I would expect there to be the possibility of the alarm being triggered up to a few seconds after the specified time, but not before.