ScheduledAgentでアラーム開始時刻を更新したいのですが、wp7で更新できますか?
protected override void OnInvoke(ScheduledTask task)
{
var schedule = Find("AlarmName")
if (schedule != null)
{
var alarm = schedule as Alarm;
ReplaceAlarm(alarm);
}
NotifyComplete();
}
private void ReplaceAlarm(Alarm alarm)
{
alarm.BeginTime = NewDateTime;
alarm.ExpirationTime = NewExpirationTime;
alarm.Content = "new Text";
try
{
ScheduledActionService.Replace(alarm as ScheduledAction);
}
catch
{
}
}
前もって感謝します。