public void RemoveObserver(IStudentObserver student) { for (int i = 0; i < coursesList.Count; i++) { coursesList[i].RemoveObserver(student); } studentList.Remove(student); }
private bool ValidateStudent(IStudentObserver o) { if (o.NameOfStudent != null && o.Age < 30 && (o.NumberOfStudent >= 10000 && o.NumberOfStudent <= 99999)) { return(true); } else { return(false); } }
public void AddObserver(IStudentObserver o) { for (int i = 0; i < studentObservers.Count; i++) { if (studentObservers[i].NumberOfStudent == o.NumberOfStudent) { return; } } if (ValidateStudent(o)) { studentObservers.Add(o); } }
public void AddObserver(IStudentObserver student, Course course) { for (int i = 0; i < studentList.Count; i++) { if (studentList[i].NumberOfStudent == student.NumberOfStudent) { return; } } if (ValidateStudent(student)) { studentList.Add(student); course.AddObserver(student); } }
public void RemoveObserver(IStudentObserver o) { studentObservers.Remove(o); }
public void Detach(IStudentObserver student) { studentObserverList.Remove(student); }
public void Attach(IStudentObserver student) { studentObserverList.Add(student); }