Exemplo n.º 1
0
        private void ChangeStatusViewLoad(object sender, EventArgs e)
        {
            if (_changeStatusPresenter == null) {
                _changeStatusPresenter = _presentersFactory.CreateChangeStatusPresenter(this,
                                                                                        _routePointViewModel);

                _routePointViewModel = _changeStatusPresenter.Initialize();
                ViewContainer.RegisterLeftAction(new Save(_changeStatusPresenter));
                ViewContainer.RegisterRightAction(new Cancel(_changeStatusPresenter));

                IEnumerable<StatusViewModel> statusViewModels = _changeStatusPresenter.GetStatuses();
                foreach (var statusViewModel in statusViewModels) {
                    var radioButton = new CustomRadioButton {
                        Text = statusViewModel.Name,
                        Checked = statusViewModel.Id == _routePointViewModel.StatusId,
                        Dock = DockStyle.Top,
                        Tag = statusViewModel,
                    };

                    radioButton.CheckedEvent += RadioButtonCheckedChanged;
                    Controls.Add(radioButton);
                }
            }
        }
Exemplo n.º 2
0
 public Cancel(ChangeStatusPresenter presenter)
 {
     _presenter = presenter;
 }
Exemplo n.º 3
0
 public Save(ChangeStatusPresenter presenter)
 {
     _presenter = presenter;
 }