示例#1
0
文件: School.cs 项目: krumov/telerik
        public void RemoveCourse(Course course)
        {
            bool courseFound = false;
            for (int i = 0; i < this.Courses.Count; i++)
            {
                if (this.Courses[i].Name == course.Name)
                {
                    courseFound = true;
                    this.Courses.Remove(course);
                }
            }

            if (!courseFound)
            {
                throw new ArgumentException("The course does not exist in this course, so there is no need to remove it!");
            }
        }
示例#2
0
文件: School.cs 项目: krumov/telerik
 public void AddCourse(Course course)
 {
     this.Courses.Add(course);
 }