コード例 #1
0
ファイル: FormEvent.cs プロジェクト: uvRen/teamb-simhopp
        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();
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
 public JudgeServer(EventPresenter presenter)
 {
 }