Inheritance: Course, ILocalCourse
示例#1
0
 public ILocalCourse CreateLocalCourse(string name, ITeacher teacher, string lab)
 {
     if (name == null || lab == null)
     {
         throw new ArgumentNullException("Error: Either name or lab are null.");
     }
     else
     {
         ILocalCourse course = new LocalCourse();
         course.Name    = name;
         course.Teacher = teacher;
         course.Lab     = lab;
         return(course);
     }
 }
示例#2
0
        static void Main()
        {
            LocalCourse localCourse = new LocalCourse("Databases");
            Console.WriteLine(localCourse);

            localCourse.Lab = "Enterprise";
            Console.WriteLine(localCourse);

            localCourse.Students = new List<string>() { "Peter", "Maria" };
            Console.WriteLine(localCourse);

            localCourse.TeacherName = "Svetlin Nakov";
            localCourse.AddStudent("Milena");
            localCourse.AddStudent("Todor");
            Console.WriteLine(localCourse);

            OffsiteCourse offsiteCourse = new OffsiteCourse(
                "PHP and WordPress Development", "Mario Peshev",
                new List<string>() { "Thomas", "Ani", "Steve" });
            Console.WriteLine(offsiteCourse);
        }
 public ILocalCourse CreateLocalCourse(string name, ITeacher teacher, string lab)
 {
     var localCourse = new LocalCourse(name, teacher, lab);
     return localCourse;
 }
示例#4
0
        public ILocalCourse CreateLocalCourse(string name, ITeacher teacher, string lab)
        {
            ICourse localCourse = new LocalCourse(name, teacher, lab);

            return((ILocalCourse)localCourse);
        }
 public ILocalCourse CreateLocalCourse(string name, ITeacher teacher, string lab)
 {
     if (name == null || lab == null)
     {
         throw new ArgumentNullException("Error: Either name or lab are null.");
     }
     else
     {
         ILocalCourse course = new LocalCourse();
         course.Name = name;
         course.Teacher = teacher;
         course.Lab = lab;
         return course;
     }
 }
示例#6
0
        public ILocalCourse CreateLocalCourse(string name, ITeacher teacher, string lab) //TODO maybe return type should be ICourse
        {
            ILocalCourse localCourse = new LocalCourse();

            return(localCourse);
        }