示例#1
0
        public List <ScheduleInfo> GetSchedules()
        {
            List <ScheduleInfo> schedInfos = new List <ScheduleInfo>();

            try
            {
                IList <Schedule> schedules = Schedule.ListAll();
                foreach (Schedule schedule in schedules)
                {
                    ScheduleInfo sched = new ScheduleInfo();
                    sched.scheduleID  = schedule.IdSchedule.ToString();
                    sched.startTime   = schedule.StartTime;
                    sched.endTime     = schedule.EndTime;
                    sched.channelName = schedule.ReferencedChannel().DisplayName;
                    sched.description = schedule.ProgramName;
                    ScheduleRecordingType stype = (ScheduleRecordingType)schedule.ScheduleType;
                    sched.type = stype.ToString();

                    schedInfos.Add(sched);
                }
            }
            catch (Exception ex)
            {
                lastException = ex;
                return(null);
            }
            return(schedInfos);
        }
        protected void InitRecordingTypeList()
        {
            DialogHeader = "[SlimTvClient.ScheduleType]";
            ScheduleRecordingType previousType = RecordingType;

            _dialogActionsList.Clear();
            foreach (ScheduleRecordingType recordingType in Enum.GetValues(typeof(ScheduleRecordingType)))
            {
                ScheduleRecordingType currentType = recordingType;
                if (currentType.ToString().Contains("EveryTime"))
                {
                    continue; // Cannot use every time options with manual recording, as they require a program name
                }
                ListItem recTypeItem = new ListItem(Consts.KEY_NAME, GetLocalizedRecordingTypeName(currentType))
                {
                    Command  = new MethodDelegateCommand(() => RecordingType = currentType),
                    Selected = currentType == previousType
                };
                _dialogActionsList.Add(recTypeItem);
            }
            _dialogActionsList.FireChange();
        }