예제 #1
0
        internal override void Add(BaseItemWin item)
        {
            if (item is HomeworkWin)
            {
                Homework.InsertSorted(item as HomeworkWin);
            }

            else if (item is ExamWin)
            {
                Exams.InsertSorted(item as ExamWin);
            }

            else if (item is ScheduleWin)
            {
                Schedules.InsertSorted(item as ScheduleWin);
            }

            else if (item is WeightCategoryWin)
            {
                WeightCategories.InsertSorted(item as WeightCategoryWin);
            }

            else
            {
                throw new NotImplementedException("Item to be added to Class wasn't any of the supported types.");
            }
        }