public StudentProperties(StudentList parent, ScheduleRepository repo, int studentId, StudentDetailsMode mode) { InitializeComponent(); _studentList = parent; _repo = repo; _student = _repo.Students.GetStudent(studentId); _mode = mode; if ((_student == null) && mode == StudentDetailsMode.Edit) { Close(); } }
private void ShowStudentListForm() { if (_studentListFormOpened) { StudentListForm.Activate(); StudentListForm.Focus(); return; } StudentListForm = new StudentList(Repo); _studentListFormOpened = true; StudentListForm.Show(); _studentListFormOpened = false; }