Beispiel #1
0
        public MainPresenter(MainGridModel mainGridModel, IMainView view, IMessagesView messagesView, IViewFactory viewFactory,
                             IMessageBoxView messageBoxView, UserStatsDataModel userStatsDataModel, IPresenterFactory presenterFactory,
                             IClientConfiguration clientConfiguration, IProteinService proteinService, IUpdateLogic updateLogic,
                             Core.ScheduledTasks.RetrievalModel retrievalModel, IExternalProcessStarter processStarter,
                             IPreferenceSet prefs, ClientSettingsManager settingsManager)
        {
            _gridModel = mainGridModel;
            _gridModel.AfterResetBindings += (sender, e) =>
            {
                // run asynchronously so binding operation can finish
                _view.BeginInvoke(new Action(() =>
                {
                    DisplaySelectedSlotData();
                    _view.RefreshControlsWithTotalsData(_gridModel.SlotTotals);
                }), null);
            };
            _gridModel.SelectedSlotChanged += (sender, e) =>
            {
                if (e.Index >= 0 && e.Index < _view.DataGridView.Rows.Count)
                {
                    // run asynchronously so binding operation can finish
                    _view.BeginInvoke(new Action(() =>
                    {
                        _view.DataGridView.Rows[e.Index].Selected = true;
                        DisplaySelectedSlotData();
                    }), null);
                }
            };
            _userStatsDataModel = userStatsDataModel;

            // Views
            _view           = view;
            _messagesView   = messagesView;
            _messageBoxView = messageBoxView;
            //
            _viewFactory      = viewFactory;
            _presenterFactory = presenterFactory;
            // Collections
            _clientConfiguration = clientConfiguration;
            _proteinService      = proteinService;
            // Logic Services
            _updateLogic       = updateLogic;
            _updateLogic.Owner = _view;
            _retrievalModel    = retrievalModel;
            _processStarter    = processStarter;
            // Data Services
            _prefs           = prefs;
            _settingsManager = settingsManager;

            _clientConfiguration.ConfigurationChanged += delegate { AutoSaveConfig(); };
        }
Beispiel #2
0
        public MainPresenter(MainGridModel mainGridModel, IMainView view, IMessagesView messagesView, IMessageBoxView messageBoxView,
            IOpenFileDialogView openFileDialogView, ISaveFileDialogView saveFileDialogView,
            IClientDictionary clientDictionary, IProteinBenchmarkCollection benchmarkCollection,
            IProteinDictionary proteinDictionary, IUnitInfoCollection unitInfoCollection, IUpdateLogic updateLogic,
            RetrievalLogic retrievalLogic, IExternalProcessStarter processStarter,
            IPreferenceSet prefs, IClientSettingsManager settingsManager)
        {
            _gridModel = mainGridModel;
             //_gridModel.BeforeResetBindings += delegate { _view.DataGridView.FreezeSelectionChanged = true; };
             _gridModel.AfterResetBindings += delegate
                                          {
                                             //_view.DataGridView.FreezeSelectionChanged = false;
                                             DisplaySelectedSlotData();
                                             _view.RefreshControlsWithTotalsData(_gridModel.SlotTotals);
                                          };
             _gridModel.SelectedSlotChanged += (sender, e) =>
                                           {
                                              if (e.Index >=0 && e.Index < _view.DataGridView.Rows.Count)
                                              {
                                                 _view.DataGridView.Rows[e.Index].Selected = true;
                                                 DisplaySelectedSlotData();
                                              }
                                           };

             // Views
             _view = view;
             _messagesView = messagesView;
             _messageBoxView = messageBoxView;
             _openFileDialogView = openFileDialogView;
             _saveFileDialogView = saveFileDialogView;
             // Collections
             _clientDictionary = clientDictionary;
             _benchmarkCollection = benchmarkCollection;
             _proteinDictionary = proteinDictionary;
             _unitInfoCollection = unitInfoCollection;
             // Logic Services
             _updateLogic = updateLogic;
             _updateLogic.Owner = _view;
             _retrievalLogic = retrievalLogic;
             _retrievalLogic.Initialize();
             _processStarter = processStarter;
             // Data Services
             _prefs = prefs;
             _settingsManager = settingsManager;

             _clientDictionary.ClientEdited += HandleClientEdit;
             _clientDictionary.DictionaryChanged += delegate { AutoSaveConfig(); };
        }
Beispiel #3
0
      public MainPresenter(MainGridModel mainGridModel, IMainView view, IMessagesView messagesView, IViewFactory viewFactory,
                           IMessageBoxView messageBoxView, UserStatsDataModel userStatsDataModel, IPresenterFactory presenterFactory,
                           IClientConfiguration clientConfiguration, IProteinService proteinService, IUpdateLogic updateLogic,
                           RetrievalModel retrievalModel, IExternalProcessStarter processStarter,
                           IPreferenceSet prefs, IClientSettingsManager settingsManager)
      {
         _gridModel = mainGridModel;
         //_gridModel.BeforeResetBindings += delegate { _view.DataGridView.FreezeSelectionChanged = true; };
         _gridModel.AfterResetBindings += delegate
                                          {
                                             //_view.DataGridView.FreezeSelectionChanged = false;
                                             DisplaySelectedSlotData();
                                             _view.RefreshControlsWithTotalsData(_gridModel.SlotTotals);
                                          };
         _gridModel.SelectedSlotChanged += (sender, e) =>
                                           {
                                              if (e.Index >= 0 && e.Index < _view.DataGridView.Rows.Count)
                                              {
                                                 _view.DataGridView.Rows[e.Index].Selected = true;
                                                 DisplaySelectedSlotData();
                                              }
                                           };
         _userStatsDataModel = userStatsDataModel;

         // Views
         _view = view;
         _messagesView = messagesView;
         _messageBoxView = messageBoxView;
         //
         _viewFactory = viewFactory;
         _presenterFactory = presenterFactory;
         // Collections
         _clientConfiguration = clientConfiguration;
         _proteinService = proteinService;
         // Logic Services
         _updateLogic = updateLogic;
         _updateLogic.Owner = _view;
         _retrievalModel = retrievalModel;
         _processStarter = processStarter;
         // Data Services
         _prefs = prefs;
         _settingsManager = settingsManager;

         _clientConfiguration.DictionaryChanged += delegate { AutoSaveConfig(); };
      }