internal override void Remove(BaseItemWin item) { if (item is HomeworkWin) { Homework.Remove(item as HomeworkWin); } else if (item is ExamWin) { Exams.Remove(item as ExamWin); } else if (item is ScheduleWin) { Schedules.Remove(item as ScheduleWin); } else if (item is WeightCategoryWin) { WeightCategories.Remove(item as WeightCategoryWin); } else { throw new NotImplementedException("Item to be removed from Class wasn't any of the supported types."); } }
internal override void Add(BaseItemWin item) { SemesterWin semester = (SemesterWin)item; semester.Parent = this; Semesters.InsertSorted(semester); }
public override int CompareTo(BaseItemWin other) { if (other is ClassWin) { return(CompareTo(other as ClassWin)); } return(base.CompareTo(other)); }
public override int CompareTo(BaseItemWin other) { if (other is ExamWin) { return(CompareTo(other as ExamWin)); } if (other is HomeworkWin) { return(CompareTo(other as HomeworkWin)); } return(base.CompareTo(other)); }
internal override void Remove(BaseItemWin item) { if (item is ClassWin) { Classes.Remove(item as ClassWin); } else if (item is TaskWin) { Tasks.Remove(item as TaskWin); } else { throw new NotImplementedException("Object being removed from Semester wasn't any of the supported types."); } }
internal override void Add(BaseItemWin item) { if (item is ClassWin) { Classes.InsertSorted(item as ClassWin); } else if (item is TaskWin) { Tasks.InsertSorted(item as TaskWin); } else { throw new NotImplementedException(); } }
internal override void Add(BaseItemWin item) { throw new NotImplementedException(); }
public override int CompareTo(BaseItemWin other) { if (other is HomeworkWin || other is ExamWin) { //if on same day, these go earlier than tasks if (Date.Date == ((ExamWin)other).Date.Date) { return(1); } //else oldest item goes first else { return(Date.CompareTo(((ExamWin)other).Date)); } } if (other is TaskWin) { TaskWin task = other as TaskWin; //if this is due on an earlier day if (Date.Date < task.Date.Date) { return(-1); } //else if this is due on a later day if (Date.Date > task.Date.Date) { return(1); } //else they're both on the same day... //if this is complete if (IsComplete) { //if both are complete if (task.IsComplete) { return(Updated.CompareTo(task.Updated)); } //other isn't complete, place this later return(1); } //else this isn't complete //if the other is complete, this goes first if (task.IsComplete) { return(-1); } //else if this is more recent, put it last return(Updated.CompareTo(task.Updated)); } return(base.CompareTo(other)); }
internal override void Remove(BaseItemWin item) { Semesters.Remove((SemesterWin)item); }
internal override void Remove(BaseItemWin item) { Years.Remove((YearWin)item); }
internal override void Add(BaseItemWin item) { Years.InsertSorted((YearWin)item); }
internal override void Remove(BaseItemWin item) { //teachers aren't supported yet throw new NotImplementedException(); }
internal override void Remove(BaseItemWin item) { Grades.Remove(item as GradeWin); }
internal override void Add(BaseItemWin item) { Grades.InsertSorted((GradeWin)item); }