Example #1
0
 public static bool Compare(Week w1, Week w2)
 {
     if ((w1.month.id == w2.month.id) && (w1.start == w2.start) && (w1.end == w2.end))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Example #2
0
        //возвращает данные по ключу
        public string GetData(Month month, Week week, int course)
        {
            ScheduleKey sk = new ScheduleKey(month, week, course);

            if (data.ContainsKey(sk))
            {
                return(data[sk]);
            }
            else
            {
                return(null);
            }
        }
Example #3
0
        //записывает данные по ключу
        public bool SetData(Month month, Week week, int course, string value)
        {
            ScheduleKey sk = new ScheduleKey(month, week, course);

            if (data.ContainsKey(sk))
            {
                data[sk] = value;
                return(true);
            }
            else
            {
                data.Add(sk, value);
                return(false);
            }
        }
Example #4
0
        public override bool Equals(object obj)
        {
            ScheduleKey sk = obj as ScheduleKey;

            return(this.course == sk.course && this.month.id == sk.month.id && Week.Compare(this.week, sk.week));
        }
Example #5
0
 public ScheduleKey(Month m, Week w, int c)
 {
     month  = m;
     week   = w;
     course = c;
 }