예제 #1
0
        public Course(string name, ITeacher teacher)
        {
            this.Name = name;
            this.Teacher = teacher;

            this.Topics = new List<string>();
        }
예제 #2
0
    public IOffsiteCourse CreateOffsiteCourse(string name, ITeacher teacher, string town)
    {
        //returns a offsiteCourse object
        IOffsiteCourse newLocalCourse = new OffsiteCourse(name, teacher, town);

        return newLocalCourse;
    }
예제 #3
0
    public ILocalCourse CreateLocalCourse(string name, ITeacher teacher, string lab)
    {
        //returns a localCourse object
        ILocalCourse newLocalCourse = new LocalCourse(name, teacher, lab);

        return newLocalCourse;
    }
        protected Course(string name, ITeacher teacher)
        {
            this.Name = name;
            this.Teacher = teacher;

            program = new List<string>();
        }
예제 #5
0
        public int AddTeacher(ITeacher teacher)
        {
            var id = this.idProvider.GenerateTeacherId();

            this.teachers.Entities.Add(id, teacher);

            return id;
        }
예제 #6
0
 public ClassInfo(DateTime dateOfConduction, DateTime  classStartHour, DateTime classEndHour, ITeacher teacher, ICourse course)
 {
     this.DateOfConduction = dateOfConduction;
     this.ClassStartHour = classStartHour;
     this.ClassEndHour = classEndHour;
     this.ClassLengthInMinutes = this.CalculateClassLengthInMinutes(this.ClassStartHour, this.ClassEndHour);
     this.ConductedClassHours = this.CalculateNumberOfHoursTaken(this.ClassLengthInMinutes);
     this.Teacher = teacher;
     this.Course = course;
 }
예제 #7
0
 public OffsiteCourse(string name, ITeacher teacher, string town)
     : base(name, teacher)
 {
     if (town != null)
     {
         this.Town = town;
     }
     else
     {
         throw new ArgumentNullException();
     }
 }
예제 #8
0
 public LocalCourse(string name, ITeacher teacher, string lab)
     : base(name, teacher)
 {
     if (lab != null)
     {
         this.Lab = lab;
     }
     else
     {
         throw new ArgumentNullException();
     }
 }
예제 #9
0
 public LocalCourses(string name, ITeacher teacher, string lab)
 {
     if (name == null || lab == null)
     {
         throw new ArgumentNullException();
     }
     this.Topic = new List<string>();
     this.Type = CourseType.LocalCourse;
     this.Name = name;
     this.Teacher = teacher;
     this.Lab = lab;
 }
예제 #10
0
 public Course(string name, ITeacher teacher)
 {
     if (name != null)
     {
         this.Teacher = teacher;
         this.Name = name;
         this.Topics = new List<string>();
     }
     else
     {
         throw new ArgumentNullException();
     }
 }
예제 #11
0
        protected Course(string name, ITeacher teacher)
        {
            if (name == null)
            {
                throw new ArgumentNullException();
            }
            else
            {
                this.Name    = name;
                this.Teacher = teacher;

                this.topics = new List <string>();
            }
        }
        static void Main(string[] args)
        {
            Program  program  = new Program(); //实例化类对象
            ITeacher iteacher = program;       //使用派生类对象实例化接口ITeacher

            iteacher.Name = "TM";
            iteacher.Sex  = "男";
            iteacher.teach();
            IStudent istudent = program;       //使用派生类对象实例化接口IStudent

            istudent.Name = "C#";
            istudent.Sex  = "男";
            istudent.study();
        }
예제 #13
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);
     }
 }
예제 #14
0
        public void ValidateAllPropertiesTest()
        {
            ITeacher teacher = new ITeacher
            {
                Surname  = "Joe",
                Forename = "Bloggs",
                DOB      = DateTime.Today,
                Phone    = "083 4567823",
                Type     = ' ',
                Salary   = 13500,
                Subjects = "Geography"
            };

            teacher.ValidateAllProperties();
        }
예제 #15
0
        public TeacherViewModel(
            IDecisionMakerFrameHandler decisionMakerFrameHandler,
            Controller controller,
            IEventAggregator eventAggregator,
            ITeacher teacher)
        {
            _controller = controller;
            _decisionMakerFrameHandler = decisionMakerFrameHandler;
            _displayedImagePath        = "../Resources/Waiting.PNG";

            CheckControllerStatus();

            _controller.FrameReady += _decisionMakerFrameHandler.Handle;
            eventAggregator.GetEvent <TeacherStateChangedEvent>().Subscribe(OnTeacherStateChangedEvent);
        }
예제 #16
0
파일: Program.cs 프로젝트: Katherinelove/C-
        static void Main(string[] args)
        {
            Program  program  = new Program();
            ITeacher iteacher = program;

            iteacher.Name = "TN";
            iteacher.Sex  = "male";
            iteacher.teach();
            IStudent istudent = program;

            istudent.Name = "zensha";
            istudent.Sex  = "nan";
            istudent.study();
            Console.ReadLine();
        }
예제 #17
0
 public OffsiteCourses(string name, ITeacher teacher, string town)
 {
     if (name == null || town == null)
     {
         throw new ArgumentNullException();
     }
     else
     {
         this.Topic = new List<string>();
         this.Type = CourseType.OffsiteCourse;
         this.Name = name;
         this.Teacher = teacher;
         this.Town = town;
     }
 }
예제 #18
0
 public IOffsiteCourse CreateOffsiteCourse(string name, ITeacher teacher, string town)
 {
     if (name == null || town == null)
     {
         throw new ArgumentNullException("Either name or town are null");
     }
     else
     {
         IOffsiteCourse course = new OffsiteCourse();
         course.Name    = name;
         course.Teacher = teacher;
         course.Town    = town;
         return(course);
     }
 }
        public bool CreateCourse(string courseName, ITeacher teacher)
        {
            Course newCourse = new Course(courseName, teacher);

            foreach (Course course in currentCourses)
            {
                if (course.Equals(newCourse))
                {
                    return(false);
                }
            }
            currentCourses.Add(newCourse);
            NotifyAllStudentsOnCourseCreate();
            return(true);
        }
예제 #20
0
        public int AddTeacher(ITeacher teacher)
        {
            if (teacher == null)
            {
                throw new ArgumentNullException(nameof(teacher));
            }

            var id = this.nextTeacherId;

            this.nextTeacherId++;

            this.teachers.Add(id, teacher);

            return(id);
        }
예제 #21
0
 public void Update(ITeacher teacher)
 {
     try
     {
         string[] str  = (teacher as Teacher).State.Split(',');
         string[] mark = str[1].Split('=');
         if ((teacher as Teacher).State.Contains(("B=" + mark[1]).ToString()) && Int32.Parse(mark[1]) > 3)
         {
             Console.WriteLine("StudentB: Well I'm happy!");
         }
     }
     catch (Exception)
     {
         Console.WriteLine("Сегодня без оценки");
     }
 }
예제 #22
0
 public void Update(ITeacher teacher)
 {
     try
     {
         string[] str  = (teacher as Teacher).State.Split(',');
         string[] mark = str[0].Split('=');
         if ((teacher as Teacher).State.Contains(("A=" + mark[1]).ToString()) && Int32.Parse(mark[1]) < 3)
         {
             Console.WriteLine("StudentA: Okay(, bad mark...");
         }
     }
     catch (Exception)
     {
         Console.WriteLine("Сегодня без оценки");
     }
 }
예제 #23
0
        private void mjButton23_Click(object sender, EventArgs e)
        {
            person pro = new person();//实例化类对象


            ITeacher iteach = pro;      //使用派生类对象实例化接口ITeacher

            iteach.Name = "橙子";
            iteach.Sex  = "男";
            MJMessageBox.Show(this, "温馨提示", iteach.teach().ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);

            IStudent istu = pro;        //使用派生类对象实例化接口IStudent

            istu.Name = "C#";
            MJMessageBox.Show(this, "温馨提示", istu.study().ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
예제 #24
0
 public void Update(ITeacher teacher)
 {
     try
     {
         string[] str  = (teacher as Teacher).State.Split(',');
         string[] mark = str[2].Split('=');
         if ((teacher as Teacher).State.Contains(("C=" + mark[1]).ToString()) && Int32.Parse(mark[1]) == 3)
         {
             Console.WriteLine("StudentC: Better luck next time");
         }
     }
     catch (Exception)
     {
         Console.WriteLine("Сегодня без оценки");
     }
 }
예제 #25
0
 /// <summary>
 /// 显示高于指定分数的所有学生
 /// </summary>
 /// <param name="teacher"></param>
 public static void DisplayScoreHighThan(this ITeacher teacher)
 {
     try
     {
         Write("你想将分数指定为: ");
         teacher.GetStuHighThan(int.Parse(ReadLine()));
     }
     catch (FormatException)
     {
         DisplayTheInformationOfErrorCode(ErrorCode.ArgumentError);
     }
     catch (ArgumentOutOfRangeException)
     {
         DisplayTheInformationOfErrorCode(ErrorCode.ArgumentOutOfRange);
     }
 }
 public ProgramacionDeSeguimientoController(IScholarshipProgramTracing scholarshipProgramTracing,
                                            IUniversity university, ITracingStudyPlanDevelopment tracingStudyPlanDevelopment,
                                            IScholarshipProgramUniversity scholarshipProgramUniversity, IAgent agent, IScholarshipProgram scholarshipProgram,
                                            IAgentType agentType, IStatus status, ISubjectMatter subjectMatter, ITeacher teacher,
                                            IScholarshipProgramUniversitySubjectMatter scholarshipProgramUniversitySubjectMatter)
 {
     _scholarshipProgramTracing = scholarshipProgramTracing;
     _university = university;
     _scholarshipProgramUniversity = scholarshipProgramUniversity;
     _agent = agent;
     _scholarshipProgram          = scholarshipProgram;
     _agentType                   = agentType;
     _status                      = status;
     _subjectMatter               = subjectMatter;
     _teacher                     = teacher;
     _tracingStudyPlanDevelopment = tracingStudyPlanDevelopment;
     _scholarshipProgramUniversitySubjectMatter = scholarshipProgramUniversitySubjectMatter;
 }
예제 #27
0
        public static void test()
        {
            Assembly assembly1 = Assembly.Load("Ite");

            Type[] type = assembly1.GetTypes();
            //foreach (var item in type)
            //{
            //    Console.WriteLine(item.Name+"\t\t"+item);
            //}
            //Console.ReadLine();
            Type     TeachType = assembly1.GetType(ObName);
            object   obj       = Activator.CreateInstance(TeachType, new object[] { 18, "邓缙柯", "朗诗" });
            ITeacher tea       = (Teacher)obj;

            tea.Teach();
            Console.WriteLine(tea.WriteSomething());
            Console.ReadLine();
        }
예제 #28
0
        // GET: Teacher
        public async Task <ActionResult> Index(string id)
        {
            OrleansHelper.EnsureOrleansClientInitialized();

            Guid teacherGuid = new Guid(id);

            ITeacher    grain       = GrainFactory.GetGrain <ITeacher>(teacherGuid);
            TeacherInfo teacherInfo = await grain.GetInfo();

            var teacher = new TeacherViewModel()
            {
                Id        = teacherGuid,
                FirstName = teacherInfo.FirstName,
                LastName  = teacherInfo.LastName
            };

            return(View(teacher));
        }
예제 #29
0
        public static void Main()
        {
            //ILocalCourse v = new LocalCourse("Some", new Teacher("Teach"), "sd");
            //ITeacher t = new Teacher("te");
            //t.AddCourse(v);

            CourseFactory factory = new CourseFactory();
            ITeacher      nakov   = factory.CreateTeacher("Nakov");

            Console.WriteLine(nakov);
            nakov.Name = "Svetlin Nakov";
            ICourse oop = factory.CreateLocalCourse("OOP", nakov, "Light");

            oop.AddTopic("Using Classes and Objects");
            oop.AddTopic("Defining Classes");
            oop.AddTopic("OOP Principles");
            oop.AddTopic("Teamwork");
            oop.AddTopic("Exam Preparation");
            Console.WriteLine(oop);
            ICourse html = factory.CreateOffsiteCourse("HTML", nakov, "Plovdiv");

            html.AddTopic("Using Classes and Objects");
            html.AddTopic("Defining Classes");
            html.AddTopic("OOP Principles");
            html.AddTopic("Teamwork");
            html.AddTopic("Exam Preparation");
            Console.WriteLine(html);
            nakov.AddCourse(oop);
            nakov.AddCourse(html);
            Console.WriteLine(nakov);
            oop.Name = "Object-Oriented Programming";
            (oop as ILocalCourse).Lab = "Enterprise";
            oop.Teacher = factory.CreateTeacher("George Georgiev");
            oop.AddTopic("Practical Exam");
            Console.WriteLine(oop);
            html.Name = "HTML Basics";
            (html as IOffsiteCourse).Town = "Varna";
            html.Teacher = oop.Teacher;
            html.AddTopic("Practical Exam");
            Console.WriteLine(html);
            ICourse css = factory.CreateLocalCourse("CSS", null, "Ultimate");

            Console.WriteLine(css);
        }
예제 #30
0
        public async Task <ActionResult> Index(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                return(View());
            }

            OrleansHelper.EnsureOrleansClientInitialized();

            Guid          classGuid = new Guid(id);
            ICollegeClass grain     = GrainFactory.GetGrain <ICollegeClass>(classGuid);

            ClassInfo classInfo = await grain.GetClassInfo();

            IList <IStudent> students = await grain.GetStudents();

            string[] studentNames = new string[0];
            if (students != null && students.Count > 0)
            {
                var studentNameTasks = new Task <string> [students.Count];
                for (int i = 0; i < students.Count; i++)
                {
                    studentNameTasks[i] = students[i].GetFullName();
                }

                studentNames = await Task.WhenAll(studentNameTasks);
            }

            ITeacher teacherGrain = GrainFactory.GetGrain <ITeacher>(classInfo.Teacher);
            string   teacherName  = await teacherGrain.GetFullName();

            var classView = new ClassViewModel()
            {
                Id        = new Guid(id),
                Name      = classInfo.Name,
                Subject   = classInfo.Subject,
                Teacher   = teacherName,
                ClassSize = studentNames.Length,
                Students  = studentNames
            };

            return(View(classView));
        }
        public void T2_creating_teacher()
        {
            Action action = (() => SchoolFactory.CreateTeacher(null, null, null, DateTime.Now, false));

            action.Should().Throw <ArgumentNullException>();

            Action action1 = (() => SchoolFactory.CreateTeacher(String.Empty, String.Empty, String.Empty, DateTime.Now, false));

            action1.Should().Throw <ArgumentNullException>();

            {
                ITeacher s = SchoolFactory.CreateTeacher("Olivier Spineli", "C#", "IL", DateTime.Parse("21/02/1994"), true);
                s.Name.Should().Be("Olivier Spineli");
                s.Course.Should().Be("C#");
                s.Orentation.Should().Be("IL");
                s.Guid.Should().NotBeEmpty();
                s.Birth.Should().BeSameDateAs(DateTime.Parse("21/02/1994"));
            }
        }
예제 #32
0
 public ProfesorController(ITeacher teacher, IContactType contactType,
                           IDocumentType documentType, ICountry country, ICity city,
                           IAddressType addressType, IStatus status, IEducationType educationType,
                           ITeacherEducation teacherEducation, INationality nationality, IMatirialStatus matirialStatus, IProvince province
                           )
 {
     _teacher          = teacher;
     _contactType      = contactType;
     _documentType     = documentType;
     _country          = country;
     _city             = city;
     _addressType      = addressType;
     _status           = status;
     _educationType    = educationType;
     _teacherEducation = teacherEducation;
     _nationality      = nationality;
     _matirialStatus   = matirialStatus;
     _province         = province;
 }
예제 #33
0
        public void AddSubjectToTeacher(string id, string nameSubject)
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id));
            }
            if (nameSubject == null)
            {
                throw new ArgumentNullException(nameof(nameSubject));
            }
            ITeacher t = GetTeacher(id);
            ISubject s = GetSubject(nameSubject);

            if (s != null)
            {
                s.AddTeacher(t);
                t.AddSubject(s);
            }
        }
        public string Execute(IList <string> parameters)
        {
            int   teacherId = int.Parse(parameters[0]);
            int   studentId = int.Parse(parameters[1]);
            float value     = float.Parse(parameters[2]);

            if (Engine.Students.ContainsKey(studentId) && Engine.Teachers.ContainsKey(teacherId))
            {
                IStudent student = Engine.Students[studentId];
                ITeacher teacher = Engine.Teachers[teacherId];

                teacher.AddMark(student, value);

                return($"Teacher {teacher.FirstName} {teacher.LastName} added mark {value} to student {student.FirstName} {student.LastName} in {teacher.Subject}.");
            }
            else
            {
                throw new ArgumentException(GlobalConstants.KeyNotFoundErrorMessage);
            }
        }
예제 #35
0
        /// <summary>
        /// 显示成绩列表
        /// </summary>
        /// <param name="teacher"></param>
        public static void DisplayAllScoreOfStudent(this ITeacher teacher, State IsDisplayRank = State.Off, State IsSort = State.Off)
        {
            if (UserRepository.StudentLibrary.Count <= 0)
            {
                DisplayTheInformationOfErrorCode(ErrorCode.NoDisplayableInformation);
                return;
            }
            DisplayAllScoreTitle(IsSort);
            teacher.ViewScoreOfAllStudent(IsDisplayRank, IsSort);

            //用于显示成绩的列的标题
            void DisplayAllScoreTitle(State isSortAndRank)
            {
                if (isSortAndRank == State.On)
                {
                    Write($"{"No.",-10}");
                }
                WriteLine($"{"Name",-10}{"C",-10}{"Java",-10}{"C++",-10}{"C#",-10}{"Html&Css",-10}{"SQL",-10}{"Total",-10}");
            }
        }
예제 #36
0
        /// <summary>
        /// Test a teacher.
        /// </summary>
        /// <param name="testNumber">The number of the test.</param>
        /// <param name="testDescription">The description of the test.</param>
        /// <param name="teacher">The teacher to test.</param>
        /// <param name="network">The network to train.</param>
        /// <param name="maxIterationCount">The maximum number of iterations.</param>
        /// <param name="maxTolerableNetworkError">The maximum tolerable network error.</param>
        private static void Test(int testNumber, string testDescription, ITeacher teacher, INetwork network, int maxIterationCount, double maxTolerableNetworkError)
        {
            // Print the number of the test and its description.
            Console.WriteLine("Test " + testNumber + " : " + testDescription);

            // Run the teacher (i.e. train the network).
            DateTime    startTime   = DateTime.Now;
            TrainingLog trainingLog = teacher.Train(network, maxIterationCount, maxTolerableNetworkError);
            DateTime    endTime     = DateTime.Now;

            // Print the results.
            Console.WriteLine("Test " + testNumber + " : Duration : " + (endTime - startTime));
            Console.WriteLine("Test " + testNumber + " : Number of iterations taken : " + trainingLog.IterationCount);
            Console.WriteLine("Test " + testNumber + " : Network error achieved : " + trainingLog.NetworkError);
            foreach (TrainingPattern trainingPattern in teacher.TrainingSet.TrainingPatterns)
            {
                double[] outputVector = network.Evaluate(trainingPattern.InputVector);
                Console.WriteLine(
                    TrainingPattern.VectorToString(trainingPattern.InputVector) +
                    " -> " +
                    TrainingPattern.VectorToString(outputVector)
                    );
            }
        }
 public IOffsiteCourse CreateOffsiteCourse(string name, ITeacher teacher, string town)
 {
     return new OffsiteCourse(name, teacher, town);
 }
예제 #38
0
 public IOffsiteCourse CreateOffsiteCourse(string name, ITeacher teacher, string town)
 {
     return(new OffsiteCourse(name, teacher, town));
 }
예제 #39
0
 public OffsiteCourse(string name, ITeacher teacher, string town)
     : base(name, teacher)
 {
     this.Town = town;
 }
예제 #40
0
 public IOffsiteCourse CreateOffsiteCourse(string name, ITeacher teacher, string town)
 {
     IOffsiteCourse offsiteCourse = new OffsiteCourse(name, town);
     offsiteCourse.Teacher = teacher;
     return offsiteCourse;
 }
예제 #41
0
 public LocalCourse(string name, string lab, ITeacher teacher = null)
     : base(name, teacher)
 {
     this.Lab = lab;
 }
예제 #42
0
 public ILocalCourse CreateLocalCourse(string name, ITeacher teacher, string lab)
 {
     var localCourse = new LocalCourse(name, teacher, lab);
     return localCourse;
 }
 public LocalCourses(string name, ITeacher teacher, string lab)
     : base(name, teacher)
 {
     this.Lab = lab;
 }
예제 #44
0
파일: Course.cs 프로젝트: stoyans/Telerik
 public Course(string name, ITeacher teacher = null)
 {
     this.Name = name;
     this.Teacher = teacher;
 }
예제 #45
0
 public OffsiteCourse(string name, ITeacher teacher)
     : this(name, teacher, null)
 {
 }
예제 #46
0
 public OffsiteCourse(string initialName, ITeacher initialTeacher, string initialTown)
     : base(initialName, initialTeacher)
 {
     this.Town = initialTown;
 }
예제 #47
0
 public IOffsiteCourse CreateOffsiteCourse(string name, ITeacher teacher, string town)
 {
     var offsiteCourse = new OffsiteCourse(name, teacher, town);
     return offsiteCourse;
 }
예제 #48
0
 protected Course(string name, ITeacher teacher)
 {
     this.Name = name;
     this.Teacher = teacher;
     this.topics = new LinkedList<string>();
 }
 public OffsiteCourse(string name, ITeacher teacher, string town)
     : base(name, teacher)
 {
     this.Town = town;
 }
예제 #50
0
 protected Course(string name, ITeacher teacher)
     : base(name)
 {
     this.Teacher = teacher;
     this.courseTopics = new List<string>();
 }
예제 #51
0
 public ILocalCourse CreateLocalCourse(string name, ITeacher teacher, string lab)
 {
     ILocalCourse localCourse = new LocalCourse(name, lab);
     localCourse.Teacher = teacher;
     return localCourse;
 }
예제 #52
0
파일: Automata.cs 프로젝트: rcijov/Ninject
 public Automata( ITeacher te, DayPeriod time)
 {
     Console.Out.Write("Create Automata Course object : ");
     Console.Out.WriteLine(time);
     gradCourse = false;
 }
예제 #53
0
 public ILocalCourse CreateLocalCourse(string name, ITeacher teacher, string lab)
 {
     return(new LocalCourse(name, teacher, lab));
 }
예제 #54
0
파일: OS.cs 프로젝트: rcijov/Ninject
 public OS(ITeacher te, DayPeriod time)
 {
     Console.Out.Write("Create OS Course object : ");
     Console.Out.WriteLine(time);
     gradCourse = true;
 }
예제 #55
0
 public LocalCourse(string name, ITeacher teacher, string lab)
     : base(name)
 {
     this.Teacher = teacher;
     this.lab = lab;
 }
예제 #56
0
 public LocalCourse(string name, ITeacher teacher, string lab)
     : base(name, teacher)
 {
     this.Lab = lab;
 }
예제 #57
0
 static void Main()
 {
     using (StreamWriter sw = new StreamWriter("../../output.txt"))
     {
         CourseFactory f    = new CourseFactory();
         ITeacher      joro = f.CreateTeacher("Joro");
         sw.WriteLine(joro);
         joro.Name = "George";
         sw.WriteLine(joro);
         ILocalCourse php = f.CreateLocalCourse("PHP", joro, "Enterprise");
         sw.WriteLine(php);
         php.AddTopic("Intro PHP");
         php.AddTopic("PHP Core");
         php.AddTopic("PHP Advanced Topics");
         php.AddTopic("PHP Exam");
         sw.WriteLine(php);
         IOffsiteCourse cpp = (new CourseFactory()).CreateOffsiteCourse("C++", joro, "Ultimate");
         sw.WriteLine(cpp);
         cpp.AddTopic("Intro C++");
         cpp.AddTopic("C++ Core");
         cpp.AddTopic("C++ Advanced Topics");
         cpp.AddTopic("C++ Exam");
         sw.WriteLine(cpp);
         joro.AddCourse(cpp);
         sw.WriteLine(joro);
         joro.AddCourse(php);
         joro.AddCourse(cpp);
         sw.WriteLine(joro);
         CourseFactory factory = new CourseFactory();
         ITeacher      nakov   = factory.CreateTeacher("Nakov");
         sw.WriteLine(nakov);
         nakov.Name = "Svetlin Nakov";
         sw.WriteLine(nakov);
         ILocalCourse oop = factory.CreateLocalCourse("OOP", null, "Light");
         sw.WriteLine(oop);
         oop.Teacher = nakov;
         sw.WriteLine(oop);
         oop.AddTopic("Using Classes and Objects");
         oop.AddTopic("Defining Classes");
         oop.AddTopic("OOP Principles");
         oop.AddTopic("Teamwork");
         oop.AddTopic("Exam Preparation");
         sw.WriteLine(oop);
         ICourse html = factory.CreateOffsiteCourse("HTML", nakov, "Plovdiv");
         html.AddTopic("Using Classes and Objects");
         sw.WriteLine(html);
         html.AddTopic("Defining Classes");
         html.AddTopic("OOP Principles");
         sw.WriteLine(html);
         html.AddTopic("Teamwork");
         html.AddTopic("Exam Preparation");
         sw.WriteLine(html);
         nakov.AddCourse(oop);
         nakov.AddCourse(html);
         sw.WriteLine(nakov);
         oop.Name = "Object-Oriented Programming";
         (oop as ILocalCourse).Lab = "Enterprise";
         oop.Teacher = factory.CreateTeacher("George Georgiev");
         oop.AddTopic("Practical Exam");
         sw.WriteLine(oop);
         html.Name = "HTML Basics";
         (html as IOffsiteCourse).Town = "Varna";
         html.Teacher = oop.Teacher;
         html.AddTopic("Practical Exam");
         sw.WriteLine(html);
         ICourse css = factory.CreateLocalCourse("CSS", null, "Ultimate");
         sw.WriteLine(css);
         for (int i = 0; i < 2; i++)
         {
             joro.AddCourse(oop);
             joro.AddCourse(oop);
             joro.AddCourse(css);
         }
         sw.WriteLine(joro);
         php.Name = "PHP Avdanced Course";
         ILocalCourse localPhp = (ILocalCourse)php;
         localPhp.Lab = "The Very Big Lab";
         php.Teacher  = nakov;
         php.AddTopic("Final PHP Topic");
         sw.WriteLine(php);
         html.Name = "PHP Avdanced Course";
         IOffsiteCourse offsiteHtml = (IOffsiteCourse)html;
         offsiteHtml.Town = "The Very Big Lab";
         html.Teacher     = null;
         html.AddTopic("Final HTML Topic");
         sw.WriteLine(html.ToString());
     }
 }
예제 #58
0
 public LocalCourse(string name, ITeacher teacher)
     : this(name, teacher, null)
 {
 }
 public ILocalCourse CreateLocalCourse(string name, ITeacher teacher, string lab)
 {
     return new LocalCourse(name, teacher, lab);
 }
예제 #60
0
 public OffsiteCourse(string name, ITeacher teacher, string town)
     : base(name)
 {
     this.Teacher = teacher;
     this.town = town;
 }