public HistoryPresenter(IPreferenceSet prefs, IQueryParametersCollection queryCollection, IHistoryView view, IQueryView queryView, IOpenFileDialogView openFileView, ISaveFileDialogView saveFileView, IMessageBoxView messageBoxView, HistoryPresenterModel model) { _prefs = prefs; _queryCollection = queryCollection; _view = view; _queryView = queryView; _openFileView = openFileView; _saveFileView = saveFileView; _messageBoxView = messageBoxView; _model = model; }
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(); }; }
public void Init() { _prefs = MockRepository.GenerateStub<IPreferenceSet>(); _queryCollection = MockRepository.GenerateStub<IQueryParametersCollection>(); _view = MockRepository.GenerateMock<IHistoryView>(); _queryView = MockRepository.GenerateMock<IQueryView>(); _openFileView = MockRepository.GenerateMock<IOpenFileDialogView>(); _saveFileView = MockRepository.GenerateMock<ISaveFileDialogView>(); _messageBoxView = MockRepository.GenerateMock<IMessageBoxView>(); _database = MockRepository.GenerateMock<IUnitInfoDatabase>(); _model = new HistoryPresenterModel(_database); }