2
在我的应用Application_Exit事件中,我试图使用ScheduledActionService设置闹钟。这部作品在其他代码不错,但在这里它保持与消息E_INVALIDARG在Windows Phone 7中设置闹钟
这里抛出一个ArgumentException是代码
string alarmName = Guid.NewGuid().ToString();
const string cookingClockAlarm = "Cooking clock alarm";
DateTime dueTime = DateTime.Now.AddSeconds(10);
var alarm = new Alarm(alarmName)
{
Content = cookingClockAlarm,
BeginTime = dueTime,
ExpirationTime = dueTime.AddSeconds(3),
RecurrenceType = RecurrenceInterval.None
};
// Register the alarm with the system.
ScheduledActionService.Add(alarm);//here I get an exception
任何想法,我做错了什么?
有趣的是,我在调用ScheduledActionService.Find时遇到了与应用程序关闭时相同的问题。 http://stackoverflow.com/questions/10510152/scheduledactionservice-find-throws-argumentexception – 2012-06-09 07:51:55