本文整理汇总了C#中Schedule.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Schedule.ToString方法的具体用法?C# Schedule.ToString怎么用?C# Schedule.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Schedule
的用法示例。
在下文中一共展示了Schedule.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
try
{
ParseArgs(args);
if (!File.Exists(_agentFile))
{
throw new FileNotFoundException("Could not load file " + _agentFile);
}
var agents = JsonConvert.DeserializeObject<List<Agent>>(File.ReadAllText(DefaultAgentFile));
var schedule = new Schedule(agents, _start, _start + new TimeSpan(28, 0, 0, 0));
schedule.FillUp();
File.WriteAllText("Schedule.txt", schedule.ToString());
Process.Start("Schedule.txt");
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
示例2: GetConflictingSchedules
public static IList<Schedule> GetConflictingSchedules(Schedule sched, out List<Schedule> notViewableSchedules)
{
notViewableSchedules = new List<Schedule>();
sched.Channel = ChannelManagement.GetChannel(sched.IdChannel);
Log.Debug("huha: GetConflictingSchedules: Schedule = " + sched.ToString());
Log.Debug("sched=" + sched.ProgramName);
var conflicts = new List<Schedule>();
IEnumerable<Schedule> schedulesList = ListAllSchedules();
IList<Card> cards = CardManagement.ListAllCards(CardIncludeRelationEnum.None).ToList(); //SEB
if (cards.Count == 0)
{
return conflicts;
}
Log.Info("huha GetConflictingSchedules: Cards.Count = {0}", cards.Count);
List<Schedule>[] cardSchedules = new List<Schedule>[cards.Count];
for (int i = 0; i < cards.Count; i++)
{
cardSchedules[i] = new List<Schedule>();
}
// GEMX: Assign all already scheduled timers to cards. Assume that even possibly overlapping schedulues are ok to the user,
// as he decided to keep them before. That's why they are in the db
foreach (Schedule schedule in schedulesList)
{
Log.Debug("existing schedule "+schedule.ProgramName+" s="+schedule.StartTime.ToString()+" id="+schedule.IdChannel.ToString());
List<Schedule> episodes = GetRecordingTimes(schedule);
Log.Debug("episodes.count=" + episodes.Count.ToString());
foreach (Schedule episode in episodes)
{
if (DateTime.Now > episode.EndTime)
{
continue;
}
var episodeBLL = new ScheduleBLL(episode);
if (episodeBLL.IsSerieIsCanceled(episode.StartTime))
{
continue;
}
IList<Schedule> overlapping;
Log.Debug("assigning schedules to card");
AssignSchedulesToCard(episode, cardSchedules, out overlapping, out notViewableSchedules);
Log.Debug("ênd of assigning schedules to card");
}
}
List<Schedule> newEpisodes = GetRecordingTimes(sched);
Log.Debug("newEpisodes.count=" + newEpisodes.Count.ToString());
foreach (Schedule newEpisode in newEpisodes)
{
if (DateTime.Now > newEpisode.EndTime)
{
continue;
}
var newEpisodeBLL = new ScheduleBLL(newEpisode);
if (newEpisodeBLL.IsSerieIsCanceled(newEpisode.StartTime))
{
continue;
}
IList<Schedule> overlapping;
List<Schedule> notViewable;
Log.Debug("assigning schedules to card");
if (!AssignSchedulesToCard(newEpisode, cardSchedules, out overlapping, out notViewable))
{
Log.Info("GetConflictingSchedules: newEpisode can not be assigned to a card = " + newEpisode);
conflicts.AddRange(overlapping);
notViewableSchedules.AddRange(notViewable);
}
Log.Debug("ênd of assigning schedules to card");
}
return conflicts;
}
示例3: GenerateScheduleButton_Click
private void GenerateScheduleButton_Click(object sender, RoutedEventArgs e)
{
var statDays = StatDaysCalendar.SelectedDates.ToList<DateTime>();
var schedule = new Schedule(Agents, ScheduleStartDatePicker.SelectedDate.Value , 28, statDays);
schedule.FillUp();
var filename = System.IO.Path.GetRandomFileName() + ".txt";
File.WriteAllText(filename, schedule.ToString());
Process.Start(filename);
((IOcsaWinApp)App.Current).ClearAgentPoints();
}