本文整理汇总了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;
}
示例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;
}