Example #1
0
        private void View_TimerClick(object sender, EventArgs e)
        {
            _model.Reset();
            ICountdownView     countdownForm      = new CountdownForm();
            CountdownModel     countdownModel     = new CountdownModel();
            CountdownPresenter countdownPresenter = new CountdownPresenter(countdownForm, countdownModel);

            countdownPresenter.SetCountdownClick += CountdownPresenter_SetCountdownClick;
            countdownForm.ShowViewDialog();
        }
Example #2
0
        public CountdownPresenter(ICountdownView view, CountdownModel model)
        {
            if (view == null)
            {
                throw new ArgumentNullException(nameof(view));
            }
            if (model == null)
            {
                throw new ArgumentNullException(nameof(model));
            }

            _view = view;
            _view.SetCoundownEnabled = false;
            _view.SetCountdownClick += View_SetCountdownClick;
            _view.CancelClick       += View_CancelClick;
            _view.MinusClick        += View_MinusClick;
            _view.PlusClick         += View_PlusClick;

            _model = model;
        }