Exemple #1
0
 public Task(String titt, String desc, DateTime day, HourWithMinutes b, HourWithMinutes e)
 {
     title            = titt;
     shortDescription = desc;
     begin            = new DateTime(day.Year, day.Month, day.Day, b.Hour, b.Minutes, 0);
     end = new DateTime(day.Year, day.Month, day.Day, e.Hour, e.Minutes, 0);
 }
Exemple #2
0
 public int CompareTo(HourWithMinutes other)//1 wieksze this, -1 mniejsze, 0 rowne
 {
     if (other.Hour > this.Hour)
     {
         return(-1);
     }
     else if (other.Hour < this.Hour)
     {
         return(1);
     }
     else
     {
         if (other.Minutes > this.minutes)
         {
             return(-1);
         }
         else if (other.Minutes < this.minutes)
         {
             return(1);
         }
         else
         {
             return(0);
         }
     }
 }
Exemple #3
0
 public static bool ifTaskIsValid(String titt, HourWithMinutes b, HourWithMinutes e)
 {
     if (titt.Length == 0 || titt.Length > 80 || b.CompareTo(e) != -1 || e == null || b == null)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
Exemple #4
0
 public OrganiserElements()
 {
     listOfDays      = new HashSet <Day>();
     listOfPartyDays = new HashSet <PartyDay>();
     //lista godzin doby co pol godziny
     hoursOfDay = new List <HourWithMinutes>();
     for (int hour = 0; hour < 24; hour++)
     {
         for (int halfhour = 0; halfhour <= 30; halfhour += 30)
         {
             HourWithMinutes newhour = new HourWithMinutes(hour, halfhour);
             hoursOfDay.Add(newhour);
         }
     }
 }
Exemple #5
0
        public void AddTask(String tittle, String desc, HourWithMinutes b, HourWithMinutes e)
        {
            Task newTask = new Task(tittle, desc, this.date, b, e);

            tasks.Add(newTask);
        }