Ejemplo n.º 1
0
        private void FindOnGoingRecordings()
        {
            DateTime now = DateTime.Now;
            ICollection <ScheduleEvent> scheduledEventsLast24h = eventSchedule.GetScheduleEvents(now.AddDays(-1.0), now, ScheduleEventStates.IsOccurring);

            foreach (ScheduleEvent scheduleEvent in scheduledEventsLast24h)
            {
                onGoingRecordings.Add(RecordingFactory.CreateFromScheduleEvent(scheduleEvent));
            }
        }
Ejemplo n.º 2
0
        private void eventSchedule_ScheduleEventStateChanged(object sender, ScheduleEventChangedEventArgs e)
        {
            ScheduleEventChange[] scheduleEventChanges = e.Changes;

            foreach (ScheduleEventChange scheduleEventChange in scheduleEventChanges)
            {
                if (scheduleEventChange.NewState == ScheduleEventStates.IsOccurring)
                {
                    ScheduleEvent scheduleEvent = eventSchedule.GetScheduleEventWithId(scheduleEventChange.ScheduleEventId);
                    onGoingRecordings.Add(RecordingFactory.CreateFromScheduleEvent(scheduleEvent));
                }
                else if (scheduleEventChange.NewState == ScheduleEventStates.HasOccurred)
                {
                    ScheduleEvent scheduleEvent = eventSchedule.GetScheduleEventWithId(scheduleEventChange.ScheduleEventId);
                    onGoingRecordings.Remove(RecordingFactory.CreateFromScheduleEvent(scheduleEvent));
                }
            }
        }