Esempio n. 1
0
 private void OnRemoveTimeSlot(TimeSlot timeSlot)
 {
     if (UnavailableDayPeriods.ContainsKey(timeSlot.Day))
     {
         UnavailableDayPeriods[timeSlot.Day].Remove(timeSlot.Period);
         if (UnavailableDayPeriods[timeSlot.Day].Count == 0)
         {
             UnavailableDayPeriods.Remove(timeSlot.Day);
         }
     }
 }
Esempio n. 2
0
 private void OnAddTimeSlot(TimeSlot timeSlot)
 {
     if (!UnavailableDayPeriods.ContainsKey(timeSlot.Day))
     {
         UnavailableDayPeriods.Add(timeSlot.Day, new HashSet <int> {
             timeSlot.Period
         });
     }
     else
     {
         UnavailableDayPeriods[timeSlot.Day].Add(timeSlot.Period);
     }
 }