public DictionaryController(
     IClientDictionary clientDictionary,
     IInputValidator inputValidator)
 {
     _clientDictionary = clientDictionary;
     _inputValidator   = inputValidator;
 }
Ejemplo n.º 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(); };
        }
Ejemplo n.º 3
0
 public RetrievalLogic(IPreferenceSet prefs, IClientDictionary clientDictionary, MainGridModel mainGridModel)
 {
     _prefs = prefs;
      _clientDictionary = clientDictionary;
      _clientDictionary.DictionaryChanged += delegate { SetTimerState(); };
      _clientDictionary.ClientDataDirty += (sender, e) =>
                                             {
                                                if (e.Name == null)
                                                {
                                                   QueueNewRetrieval();
                                                }
                                                else
                                                {
                                                   RetrieveSingleClient(e.Name);
                                                }
                                             };
      _mainGridModel = mainGridModel;
 }
Ejemplo n.º 4
0
        public MainGridModel(IPreferenceSet prefs, ISynchronizeInvoke syncObject, IClientDictionary clientDictionary)
        {
            _prefs = prefs;
             _syncObject = syncObject;
             _clientDictionary = clientDictionary;
             _slotList = new SlotModelSortableBindingList(_syncObject);
             _slotList.OfflineClientsLast = _prefs.Get<bool>(Preference.OfflineLast);
             _slotList.Sorted += (sender, e) =>
                             {
                                SortColumnName = e.Name;
                                _prefs.Set(Preference.FormSortColumn, SortColumnName);
                                SortColumnOrder = e.Direction;
                                _prefs.Set(Preference.FormSortOrder, SortColumnOrder);
                             };
             _bindingSource = new BindingSource();
             _bindingSource.DataSource = _slotList;
             _bindingSource.CurrentItemChanged += delegate
                                              {
                                                 SelectedSlot = (SlotModel)_bindingSource.Current;
                                              };
            #if DEBUG
             _slotList.ListChanged += (s, e) =>
                                  {
                                     Debug.WriteLine("BindingList: " + e.ListChangedType);
                                  };
             _bindingSource.ListChanged += (s, e) =>
                                       {
                                          Debug.WriteLine("BindingSource: " + e.ListChangedType);
                                       };
            #endif
             // Subscribe to PreferenceSet events
             _prefs.OfflineLastChanged += delegate
                                      {
                                         _slotList.OfflineClientsLast = _prefs.Get<bool>(Preference.OfflineLast);
                                         Sort();
                                      };
             _prefs.PpdCalculationChanged += delegate { ResetBindings(); };
             _prefs.DecimalPlacesChanged += delegate { ResetBindings(); };
             _prefs.CalculateBonusChanged += delegate { ResetBindings(); };

             // Subscribe to ClientDictionary events
             _clientDictionary.DictionaryChanged += delegate { ResetBindings(); };
             _clientDictionary.ClientDataInvalidated += delegate { ResetBindings(); };
        }
Ejemplo n.º 5
0
        public BenchmarksForm(IPreferenceSet prefs, IProteinDictionary proteinDictionary, IProteinBenchmarkCollection benchmarkCollection,
            IClientDictionary clientDictionary, IMessageBoxView messageBoxView, IExternalProcessStarter processStarter)
        {
            _prefs = prefs;
             _proteinDictionary = proteinDictionary;
             _benchmarkCollection = benchmarkCollection;
             _graphColors = _prefs.Get<List<Color>>(Preference.GraphColors);
             _clientDictionary = clientDictionary;
             _messageBoxView = messageBoxView;
             _processStarter = processStarter;
             _zedGraphManager = new ZedGraphManager();

             InitializeComponent();
        }