private void AddOrUpdateSystemTimer(TimerInfo item, bool scheduleSystemWakeTimer) { StopTimer(item); if (!ShouldStartTimer(item)) { return; } var startDate = RecordingHelper.GetStartTime(item); var now = DateTime.UtcNow; if (startDate < now) { EventHelper.FireEventIfNotNull(TimerFired, this, new GenericEventArgs <TimerInfo> { Argument = item }, Logger); return; } var dueTime = startDate - now; StartTimer(item, dueTime); if (scheduleSystemWakeTimer && dueTime >= TimeSpan.FromMinutes(15)) { ScheduleSystemWakeTimer(startDate, item.Name); } }
private void AddOrUpdateSystemTimer(TimerInfo item) { StopTimer(item); if (!ShouldStartTimer(item)) { return; } var startDate = RecordingHelper.GetStartTime(item); var now = DateTime.UtcNow; if (startDate < now) { EventHelper.FireEventIfNotNull(TimerFired, this, new GenericEventArgs<TimerInfo> { Argument = item }, Logger); return; } var dueTime = startDate - now; StartTimer(item, dueTime); }
private void AddOrUpdateSystemTimer(TimerInfo item) { StopTimer(item); if (!ShouldStartTimer(item)) { return; } var startDate = RecordingHelper.GetStartTime(item); var now = DateTime.UtcNow; if (startDate < now) { TimerFired?.Invoke(this, new GenericEventArgs <TimerInfo>(item)); return; } var dueTime = startDate - now; StartTimer(item, dueTime); }