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


C# Schedule.ToString方法代码示例

本文整理汇总了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());
            }
        }
开发者ID:GuillaumeCR,项目名称:OnCallScheduler,代码行数:21,代码来源:Program.cs

示例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;
    }
开发者ID:huha001,项目名称:TvWishList,代码行数:74,代码来源:ScheduleManagementhuha.cs

示例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();
 }
开发者ID:GuillaumeCR,项目名称:OnCallScheduler,代码行数:10,代码来源:MainWindow.xaml.cs


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