Пример #1
0
        private AggregationPeriod(int id, string description, char flag, Func <DateTime, DateTime> roundDown, Func <DateTime, DateTime> next, Func <DateTime, string> dateText)
        {
            Flag        = flag;
            RoundDown   = roundDown;
            Next        = next;
            DateText    = dateText;
            Id          = id;
            Description = description;

            AllPeriods.Add(this);
        }
Пример #2
0
 public TimetableStructureWeek(string name, IList <string> days, IList <string> periods, IList <int> unschedulable)
 {
     Name               = name;
     DayNames           = days;
     PeriodNames        = periods;
     TotalPeriods       = periods.Count * days.Count;
     TotalSchedulable   = TotalPeriods;
     UnavailablePeriods = unschedulable;
     for (int i = 0; i < DayNames.Count; i++)
     {
         DaySchedulable.Add(0);
     }
     for (int i = 0; i < TotalPeriods; i++)
     {
         AllPeriods.Add(true);
     }
     foreach (int index in unschedulable)
     {
         AllPeriods[index] = false;
         TotalSchedulable--;
         DaySchedulable[index / PeriodNames.Count]++;
     }
 }