Esempio n. 1
0
        private void RefreshUpcomingPrograms()
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;

                UpcomingOrActiveProgramsList upcomingPrograms;
                if (_scheduleType == ScheduleType.Recording)
                {
                    UpcomingRecordingsFilter filter = _showSkippedRecordings.Checked ?
                                                      UpcomingRecordingsFilter.All : UpcomingRecordingsFilter.Recordings | UpcomingRecordingsFilter.CancelledByUser;
                    var allUpcomingRecordings = Proxies.ControlService.GetAllUpcomingRecordings(filter, true).Result;
                    _upcomingProgramsControl.UnfilteredUpcomingRecordings = new UpcomingOrActiveProgramsList(allUpcomingRecordings);
                    upcomingPrograms = new UpcomingOrActiveProgramsList(allUpcomingRecordings);
                    upcomingPrograms.RemoveActiveRecordings(Proxies.ControlService.GetActiveRecordings().Result);
                }
                else
                {
                    _upcomingProgramsControl.UnfilteredUpcomingRecordings = null;
                    upcomingPrograms = new UpcomingOrActiveProgramsList(Proxies.SchedulerService.GetAllUpcomingPrograms(_scheduleType, true).Result);
                }

                ScheduleSummary schedule = _schedulesComboBox.SelectedItem as ScheduleSummary;
                if (schedule != null)
                {
                    upcomingPrograms.ApplyScheduleFilter(schedule.ScheduleId);
                }

                _upcomingProgramsControl.UpcomingPrograms = upcomingPrograms;
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, null, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
        private void RefreshUpcomingPrograms()
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;

                UpcomingOrActiveProgramsList upcomingPrograms;
                if (_scheduleType == ScheduleType.Recording)
                {
                    UpcomingRecordingsFilter filter = _showSkippedRecordings.Checked ?
                        UpcomingRecordingsFilter.All : UpcomingRecordingsFilter.Recordings|UpcomingRecordingsFilter.CancelledByUser;
                    var allUpcomingRecordings = Proxies.ControlService.GetAllUpcomingRecordings(filter, true).Result;
                    _upcomingProgramsControl.UnfilteredUpcomingRecordings = new UpcomingOrActiveProgramsList(allUpcomingRecordings);
                    upcomingPrograms = new UpcomingOrActiveProgramsList(allUpcomingRecordings);
                    upcomingPrograms.RemoveActiveRecordings(Proxies.ControlService.GetActiveRecordings().Result);
                }
                else
                {
                    _upcomingProgramsControl.UnfilteredUpcomingRecordings = null;
                    upcomingPrograms = new UpcomingOrActiveProgramsList(Proxies.SchedulerService.GetAllUpcomingPrograms(_scheduleType, true).Result);
                }

                ScheduleSummary schedule = _schedulesComboBox.SelectedItem as ScheduleSummary;
                if (schedule != null)
                {
                    upcomingPrograms.ApplyScheduleFilter(schedule.ScheduleId);
                }

                _upcomingProgramsControl.UpcomingPrograms = upcomingPrograms;
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, null, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }