当前位置: 首页>>代码示例>>C#>>正文


C# ISchedulerService.CreateNewSchedule方法代码示例

本文整理汇总了C#中ISchedulerService.CreateNewSchedule方法的典型用法代码示例。如果您正苦于以下问题:C# ISchedulerService.CreateNewSchedule方法的具体用法?C# ISchedulerService.CreateNewSchedule怎么用?C# ISchedulerService.CreateNewSchedule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISchedulerService的用法示例。


在下文中一共展示了ISchedulerService.CreateNewSchedule方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateRecordOnceSchedule

 public static Schedule CreateRecordOnceSchedule(ISchedulerService tvSchedulerAgent, ChannelType channelType, Guid channelId, string title, string subTitle, string episodeNumber, DateTime startTime)
 {
     Schedule schedule = tvSchedulerAgent.CreateNewSchedule(channelType, ScheduleType.Recording);
     schedule.Name = GuideProgram.CreateProgramTitle(title, subTitle, episodeNumber);
     schedule.Rules.Add(ScheduleRuleType.Channels, channelId);
     schedule.Rules.Add(ScheduleRuleType.OnDate, startTime.Date);
     schedule.Rules.Add(ScheduleRuleType.AroundTime, new ScheduleTime(startTime.TimeOfDay));
     schedule.Rules.Add(ScheduleRuleType.TitleEquals, title);
     if (!String.IsNullOrEmpty(subTitle))
     {
         schedule.Rules.Add(ScheduleRuleType.SubTitleEquals, subTitle);
     }
     else if (!String.IsNullOrEmpty(episodeNumber))
     {
         schedule.Rules.Add(ScheduleRuleType.EpisodeNumberEquals, episodeNumber);
     }
     return schedule;
 }
开发者ID:ElRakiti,项目名称:ARGUS-TV,代码行数:18,代码来源:GuideController.cs

示例2: CreateRecordRepeatingSchedule

        public static Schedule CreateRecordRepeatingSchedule(ISchedulerService tvSchedulerAgent, RepeatingType repeatingType, ChannelType channelType,
            Guid channelId, string title, DateTime startTime, string titleSuffix = null)
        {
            Schedule schedule = tvSchedulerAgent.CreateNewSchedule(channelType, ScheduleType.Recording);

            if (repeatingType == RepeatingType.AnyTime)
            {
                schedule.Name = title + (titleSuffix ?? " (Any Time)");
                schedule.Rules.Add(ScheduleRuleType.NewEpisodesOnly, true);
            }
            else if (repeatingType == RepeatingType.Weekly)
            {
                schedule.Name = title + (titleSuffix ?? " (Weekly)");
                schedule.Rules.Add(ScheduleRuleType.DaysOfWeek, GetDaysOfWeek(startTime));
                schedule.Rules.Add(ScheduleRuleType.AroundTime, new ScheduleTime(startTime.TimeOfDay));
            }
            else if (repeatingType == RepeatingType.MonFri)
            {
                schedule.Name = title + (titleSuffix ?? " (Mon-Fri)");
                schedule.Rules.Add(ScheduleRuleType.DaysOfWeek, ScheduleDaysOfWeek.WorkingDays);
                schedule.Rules.Add(ScheduleRuleType.AroundTime, new ScheduleTime(startTime.TimeOfDay));
            }
            else if (repeatingType == RepeatingType.SatSun)
            {
                schedule.Name = title + (titleSuffix ?? " (Sat-Sun)");
                schedule.Rules.Add(ScheduleRuleType.DaysOfWeek, ScheduleDaysOfWeek.Weekends);
                schedule.Rules.Add(ScheduleRuleType.AroundTime, new ScheduleTime(startTime.TimeOfDay));
            }
            else
            {
                schedule.Name = title + (titleSuffix ?? " (Daily)");
                schedule.Rules.Add(ScheduleRuleType.AroundTime, new ScheduleTime(startTime.TimeOfDay));
            }

            schedule.Rules.Add(ScheduleRuleType.Channels, channelId);
            schedule.Rules.Add(ScheduleRuleType.TitleEquals, title);
            return schedule;
        }
开发者ID:ElRakiti,项目名称:ARGUS-TV,代码行数:38,代码来源:SchedulesHelper.cs


注:本文中的ISchedulerService.CreateNewSchedule方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。