Exemplo n.º 1
0
 /// <summary>
 /// Metoda testuje, zda (celá) hodina representovaná údajem time (třídy WeekHour) leží uvnitř časového
 /// intervalu události (v naší representaci tam leží buď celá nebo vůbec)
 /// </summary>
 public bool WeekHourIsInside(WeekHour time)
 {
     return(time.Year == this.Start.Year &&
            time.Week == this.Start.Week &&           //FIXME: eventy přes hranici týdne (malá priorita)
            time.DayOfWeek == this.Start.DayOfWeek && //FIXME: eventy přes hranici dne (malá priorita)
            time.Hour >= this.Start.Hour &&
            time.Hour <= this.Start.Hour + Duration - 1);
 }
Exemplo n.º 2
0
 public Event EventInTime(WeekHour time)
 {
     foreach (Event e in scheduler)
     {
         if (e.WeekHourIsInside(time))
         {
             return(e);
         }
     }
     return(null);
 }
Exemplo n.º 3
0
        }                                               //stručný popis

        public Event(WeekHour start, int duration, string description)
        {
            Start       = start;
            Duration    = duration;
            Description = description;
        }