Beispiel #1
0
        public UserPresenter(RadListView listView, RadButton addUserButton, SingleProfileModel model) : base(model)
        {
            if (listView == null)
            {
                throw new ArgumentNullException("control");
            }
            _listView = listView;
            _listView.VisualItemCreating   += UsersListView_VisualItemCreating;
            _listView.VisualItemFormatting += UsersListView_VisualItemFormatting;
            _listView.CurrentItemChanged   += UsersListView_CurrentItemChanged;

            _addUserButton        = addUserButton;
            _addUserButton.Click += AddUserHandler;

            UpdateList();

            Model.UserAdded   += UserAddedHandler;
            Model.UserRemoved += UserRemovedHandler;
            Model.UserUpdated += UserUpdatedHandler;
        }
Beispiel #2
0
 public Presenter(SingleProfileModel model)
 {
     this._model = model;
     ManagerProvider.getManager <VersionManager>().VersionChanged += Presenter_VersionChanged;
 }
 public PersonalDetailsPresenter(TableLayoutPanel profilePanel, RadPanel profileMenuPanel, RadLabel targetWeightLabel, SingleProfileModel model) : base(model)
 {
     if (profilePanel == null || profileMenuPanel == null)
     {
         throw new ArgumentNullException("control");
     }
     _panel                    = profilePanel;
     _menuPanel                = profileMenuPanel;
     _targetWeightLabel        = targetWeightLabel;
     Model.CurrentUserChanged += CurrentUserChangedHandler;
 }
 public MenuPresenter(RadPanel upperPanel, RadPanel dietPanel, RadPanel buttonsPanel, SingleProfileModel model) : base(model)
 {
     if (dietPanel == null || buttonsPanel == null)
     {
         throw new ArgumentNullException("control");
     }
     _upperPanel               = upperPanel;
     _dietPanel                = dietPanel;
     _buttonsPanel             = buttonsPanel;
     Model.CurrentUserChanged += CurrentUserChangedHandler;
     ButtonsPanel.Controls[0].Controls.OfType <RadButton>().Where(o => o.Name == "_deleteDietButton").Single().Click += DeleteDietClickHandler;
     ButtonsPanel.Controls[0].Controls.OfType <RadButton>().Where(o => o.Name == "_newDietButton").Single().Click    += NewDietClickHandler;
 }