public FormEvent(EventPresenter presenter = null) { Closing = false; if (presenter == null) { Exception ex = new Exception("Ingen presenter"); ExceptionHandler.Handle(ex); } else { Presenter = presenter; } if (_presenter.CurrentEvent.Divers.Count > 0) { if (_presenter.CurrentEvent.Divers[0].Dives.Count != _presenter.CurrentEvent.diveCount) { Exception ex = new Exception("Antal hopp i tävlingen matchar inte deltagares hopp!"); ExceptionHandler.Handle(ex); } } InitializeComponent(); //Initiera objekt _divePanels = new List<List<Panel>>(); _pagePanels = new List<Panel>(); CurrentDiverIndex = CurrentRoundIndex = CurrentJudgeIndex = 0; tabsRounds.SelectedIndexChanged += tabsRounds_TabIndexChanged; DrawPanels(); }
/// <summary> /// Inloggnings-svar från servern. Loggar in som vald domare /// </summary> /// <param name="msg"></param> public void AssignLogin(SimhoppMessage msg) { EventPresenter presenter = new EventPresenter(null, msg.Status.Contest); presenter.SetMode(EventPresenter.ViewMode.Client, (int)msg.Value, judgeClient, this.Icon); Console.WriteLine("Assigning login: " + msg.Serialize()); judgeClient.Presenter = presenter; this.Hide(); presenter.ShowView(); }
public FrmEvents(UserControl userControl, string position, bool update, int id) { InitializeComponent(); th = new ThemeHelper(); eventPresenter = new EventPresenter(); fh = new FormHelper(); th.setFormColor(this); th.setPanelColor(panelTop); th.setGroupBoxColor(groupEventInfo); th.setGroupBoxColor(groupGuests); th.setCheckBoxColor(checkGuests); th.setButtonColor(btnAdd); th.setButtonColor(btnUpdate); th.setButtonColor(btnDelete); th.setButtonColor(btnShowDetails); th.setLabelColor(lblEventName); th.setLabelColor(lblVenue); th.setLabelColor(lblDate); th.setLabelColor(lblTime); th.setLabelColor(lblTime); th.setLabelColor(lblStudentRegistrationFee); th.setLabelColor(lblStudentSlots); th.setLabelColor(lblGuestRegistrationFee); th.setLabelColor(lblGuestSlots); event_id = id; this.position = position; if (this.position != "Adviser") { activation = false; switchIsActivated.Hide(); lblStatus.Hide(); lblSwitchStatus.Hide(); this.Size = new Size(614, 673); } if (update) { btnUpdate.Enabled = true; btnUpdate.FlatStyle = FlatStyle.Flat; btnDelete.Enabled = true; btnDelete.FlatStyle = FlatStyle.Flat; populateFields(); } else { btnUpdate.Enabled = false; btnUpdate.FlatStyle = FlatStyle.Standard; btnDelete.Enabled = false; btnDelete.FlatStyle = FlatStyle.Standard; this.Size = new Size(614, 673); } currentUserControl = userControl; }
public CtrlEvents(string position) { InitializeComponent(); eventPresenter = new EventPresenter(); fh = new FormHelper(); btnUpdate.Enabled = false; btnUpdate.FlatStyle = FlatStyle.Standard; btnDelete.Enabled = false; btnDelete.FlatStyle = FlatStyle.Standard; dateFrom.Value = DateTime.Now.Date; dateTo.Value = DateTime.Now.Date; this.position = position; if (this.position != "Adviser") { activation = false; switchIsActivated.Hide(); lblStatus.Hide(); lblSwitchStatus.Hide(); } }
public void ResultClick() { if (_view.ListViewEvent.SelectedItems.Count > 0) { try { _view.Hide(); Contest c = Database.GetContest(Int32.Parse(_view.ListViewEvent.SelectedItems[0].SubItems[5].Text)); Database.GetScoresToDives(c); EventPresenter presenter = new EventPresenter(null, c); presenter.ShowViewDialog(); _view.Show(); } catch (Exception ex) { ExceptionHandler.Handle(ex); } } else { MessageBox.Show("Välj ett event, försök igen", "Fel format", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
public JudgeServer(EventPresenter presenter) { }