상속: 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);
        }
예제 #3
0
 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);
        }
예제 #5
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;
     }
 }
예제 #6
0
        public ILocalCourse CreateLocalCourse(string name, ITeacher teacher, string lab) //TODO maybe return type should be ICourse
        {
            ILocalCourse localCourse = new LocalCourse();

            return(localCourse);
        }