示例#1
0
 public Student(DeanOffice deanOffice)
 {
     if (deanOffice == null)
     {
         throw new ArgumentNullException();
     }
     Name = Randomizer.GetStudentName();
     _deanOffice = deanOffice;
 }
 private void OnExamStarted(object sender, EventArgs e)
 {
     _isPaused = false;
     _amountStudentsPassed = 0;
     _amountStudents = Randomizer.GetAmountStudents();
     if (_amountStudents == 0)
     {
         _view.InformAboutFinish();
         return;
     }
     _deanOffice = new DeanOffice(this);
     for (var i = 0; i < _amountStudents; i++)
     {
         new Thread(new Student(_deanOffice).AttemptToPassExam).Start();
     }
     _deanOffice.StartExamination();
 }