// Instance constructor public ResultPresenter(ResultView view, ProjectMainWindow window, Contest contest) { this.View = view; this.window = window; this.Model = contest; TestData(); foreach (var subcontest in Model.SubContestBranches) { View.ListViewSubContests.Items.Add(subcontest.Name); } View.EventSubContestSelection += SubContestSelected; }
/// <summary> /// Close the contest, saving all the information to the database, and present the ResultView /// </summary> private void CloseContest() { HeadJudgeWindow?.Close(); Database db = new Database(); try { db.PushContest(CurrentContest); } catch (Exception e) { Console.WriteLine(e.Message); } Server?.Kill(); ResultView resultView = new ResultView(); ResultPresenter resultPresenter = new ResultPresenter(resultView, window, CurrentContest); window.ChangePanel(resultView, View); }