public ProjectDownloader(IProteinService proteinService) { if (proteinService == null) { throw new ArgumentNullException("proteinService"); } _proteinService = proteinService; }
public TextBenchmarksReport(IPreferences preferences, IProteinService proteinService, IProteinBenchmarkService benchmarkService, ClientConfiguration clientConfiguration) : base(KeyName) { Preferences = preferences ?? new InMemoryPreferencesProvider(); ProteinService = proteinService ?? NullProteinService.Instance; BenchmarkService = benchmarkService ?? NullProteinBenchmarkService.Instance; ClientConfiguration = clientConfiguration; }
public WorkUnitRepository(ILogger logger, IProteinService proteinService) { Logger = logger ?? NullLogger.Instance; ProteinService = proteinService ?? NullProteinService.Instance; _mapper = new MapperConfiguration(cfg => cfg.AddProfile <WorkUnitRowProfile>()).CreateMapper(); SQLiteFunction.RegisterFunction(typeof(ToSlotType)); SQLiteFunction.RegisterFunction(typeof(GetProduction)); }
public FahClient(ILogger logger, IPreferences preferences, IProteinBenchmarkService benchmarkService, IProteinService proteinService, IWorkUnitRepository workUnitRepository) : base(logger, preferences, benchmarkService) { ProteinService = proteinService; WorkUnitRepository = workUnitRepository; Messages = new FahClientMessages(this); _slots = new List <SlotModel>(); _slotsLock = new ReaderWriterLockSlim(); }
public WorkUnitHistoryPresenter(WorkUnitHistoryModel model, ILogger logger, IServiceScopeFactory serviceScopeFactory, MessageBoxPresenter messageBox, IProteinService proteinService) : base(model) { Model = model; Logger = logger ?? NullLogger.Instance; ServiceScopeFactory = serviceScopeFactory ?? NullServiceScopeFactory.Instance; MessageBox = messageBox ?? NullMessageBoxPresenter.Instance; ProteinService = proteinService ?? NullProteinService.Instance; }
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(); }; }
protected ProteinDataUpdaterBase(SQLiteConnection connection, IProteinService proteinService) { if (connection == null) { throw new ArgumentNullException("connection"); } if (proteinService == null) { throw new ArgumentNullException("proteinService"); } _connection = connection; _proteinService = proteinService; }
public MainPresenter(MainModel model, ILogger logger, IServiceScopeFactory serviceScopeFactory, MessageBoxPresenter messageBox, ClientConfiguration clientConfiguration, IProteinService proteinService, EocStatsScheduledTask eocStatsScheduledTask) : base(model) { Model = model; Logger = logger ?? NullLogger.Instance; ServiceScopeFactory = serviceScopeFactory ?? NullServiceScopeFactory.Instance; MessageBox = messageBox ?? NullMessageBoxPresenter.Instance; ClientConfiguration = clientConfiguration; ProteinService = proteinService ?? NullProteinService.Instance; UserStatsDataModel = new UserStatsDataModel(Form, Model.Preferences, eocStatsScheduledTask); Preferences = Model.Preferences; GridModel = new MainGridModel(Form, Model.Preferences, clientConfiguration); GridModel.Load(); GridModel.AfterResetBindings += (s, e) => { // Create a local reference before handing off to BeginInvoke. // This ensures that the BeginInvoke action uses the state of GridModel properties available now, // not the state of GridModel properties when the BeginInvoke action is executed (at a later time). var selectedSlot = GridModel.SelectedSlot; var slotTotals = GridModel.SlotTotals; // run asynchronously so binding operation can finish Form.BeginInvoke(new Action(() => { Model.GridModelSelectedSlotChanged(selectedSlot); Model.GridModelSlotTotalsChanged(slotTotals); }), null); }; GridModel.PropertyChanged += (s, e) => { switch (e.PropertyName) { case nameof(MainGridModel.SelectedSlot): // Create a local reference before handing off to BeginInvoke. // This ensures that the BeginInvoke action uses the state of GridModel properties available now, // not the state of GridModel properties when the BeginInvoke action is executed (at a later time). var selectedSlot = GridModel.SelectedSlot; // run asynchronously so binding operation can finish Form.BeginInvoke(new Action(() => Model.GridModelSelectedSlotChanged(selectedSlot)), null); break; } }; _settingsManager = new ClientSettingsManager(Logger); ClientConfiguration.ClientConfigurationChanged += (s, e) => AutoSaveConfig(); }
public BenchmarksForm(IPreferenceSet prefs, IProteinService proteinService, IProteinBenchmarkService benchmarkService, IClientConfiguration clientConfiguration, IMessageBoxView messageBoxView, IExternalProcessStarter processStarter) { _prefs = prefs; _proteinService = proteinService; _benchmarkService = benchmarkService; _graphColors = _prefs.Get <List <Color> >(Preference.GraphColors); _clientConfiguration = clientConfiguration; _messageBoxView = messageBoxView; _processStarter = processStarter; _zedGraphManager = new ZedGraphManager(); InitializeComponent(); StartPosition = FormStartPosition.Manual; }
public void Initialize(MainPresenter presenter, IProteinService service, UserStatsDataModel userStatsDataModel) { _presenter = presenter; // Resize can be invoked when InitializeComponent() is called // if the DPI is not set to Normal (96 DPI). The MainFormResize // method depends on _presenter HAVING A VALUE. Wait to hook // up this event until after _presenter has been set (above). Resize += MainFormResize; #region Initialize Controls // Manually Create the Columns - Issue 41 dataGridView1.AutoGenerateColumns = false; SetupDataGridViewColumns(dataGridView1); // Add Column Selector new DataGridViewColumnSelector(dataGridView1); // Give the Queue Control access to the Protein Collection queueControl.SetProteinService(service); #endregion // Initialize the Presenter _presenter.Initialize(); BindToUserStatsDataModel(userStatsDataModel); // Hook-up Status Label Event Handlers SubscribeToStatsLabelEvents(); #region Hook-up DataGridView Event Handlers for Mono // If Mono, use the RowEnter Event (which was what 0.3.0 and prior used) // to set the CurrentInstance selection. Obviously Mono doesn't fire the // DataGridView.SelectionChanged Event. if (Core.Application.IsRunningOnMono) { //dataGridView1.RowEnter += delegate //{ // _presenter.SetSelectedInstance(GetSelectedRowInstanceName(dataGridView1.SelectedRows)); //}; //// Use RowLeave to clear data grid when selecting New file under Mono //dataGridView1.RowLeave += delegate //{ // _presenter.SetSelectedInstance(GetSelectedRowInstanceName(dataGridView1.SelectedRows)); //}; } #endregion }
public ProteinDataUpdater(IUnitInfoDatabase database, IProteinService proteinService) { if (database == null) { throw new ArgumentNullException("database"); } if (proteinService == null) { throw new ArgumentNullException("proteinService"); } _database = database; _proteinService = proteinService; Debug.Assert(_database.Connected); }
public BenchmarksModel(IPreferences preferences, IProteinService proteinService, IProteinBenchmarkService benchmarkService, IEnumerable <BenchmarksReport> reports) { Preferences = preferences ?? new InMemoryPreferencesProvider(); ProteinService = proteinService ?? NullProteinService.Instance; BenchmarkService = benchmarkService ?? NullProteinBenchmarkService.Instance; Reports = reports ?? Array.Empty <BenchmarksReport>(); SlotIdentifiers = new BindingSource(); SlotIdentifiers.DataSource = new BindingList <ListItem> { RaiseListChangedEvents = false }; SlotProjects = new BindingSource(); SlotProjects.DataSource = new BindingList <ListItem> { RaiseListChangedEvents = false }; SelectedSlotProjectListItems = new BindingSourceListItemCollection(SlotProjects); }
public UnitInfoDatabase(IPreferenceSet prefs, IProteinService proteinService, ILogger logger) { if (proteinService == null) { throw new ArgumentNullException("proteinService"); } _proteinService = proteinService; if (logger != null) { _logger = logger; } SQLiteFunction.RegisterFunction(typeof(ToSlotType)); SQLiteFunction.RegisterFunction(typeof(GetProduction)); ForceDateTimesToUtc = true; if (prefs != null && !String.IsNullOrEmpty(prefs.ApplicationDataFolderPath)) { DatabaseFilePath = System.IO.Path.Combine(prefs.ApplicationDataFolderPath, Constants.SqLiteFilename); } }
// Tools Menu Handling Methods public void ToolsDownloadProjectsClick(IProteinService proteinService) { try { IEnumerable <ProteinChange> result = null; using (var dialog = new ProgressDialog((progress, token) => result = proteinService.Refresh(progress), false)) { dialog.Text = Core.Application.NameAndVersion; dialog.ShowDialog(Form); if (dialog.Exception != null) { Logger.Error(dialog.Exception.Message, dialog.Exception); MessageBox.ShowError(dialog.Exception.Message, Core.Application.NameAndVersion); } } if (result != null) { var proteinChanges = result.Where(x => x.Action != ProteinChangeAction.None).ToList(); if (proteinChanges.Count > 0) { if (ClientConfiguration.Count > 0) { ClientConfiguration.ScheduledTasks.RetrieveAll(); } using (var dialog = new ProteinChangesDialog(proteinChanges)) { dialog.ShowDialog(Form); } } } } catch (Exception ex) { MessageBox.ShowError(ex.Message, Core.Application.NameAndVersion); } }
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(); }; }
public BenchmarksForm(IPreferenceSet prefs, IProteinService proteinService, IProteinBenchmarkCollection benchmarkCollection, IClientConfiguration clientConfiguration, IMessageBoxView messageBoxView, IExternalProcessStarter processStarter) { _prefs = prefs; _proteinService = proteinService; _benchmarkCollection = benchmarkCollection; _graphColors = _prefs.Get<List<Color>>(Preference.GraphColors); _clientConfiguration = clientConfiguration; _messageBoxView = messageBoxView; _processStarter = processStarter; _zedGraphManager = new ZedGraphManager(); InitializeComponent(); StartPosition = FormStartPosition.Manual; }
public UnitInfoDatabase(IPreferenceSet prefs, IProteinService proteinService) : this(prefs, proteinService, null) { }
public ProteinCalculatorModel(IPreferenceSet prefs, IProteinService proteinService) { _prefs = prefs; _proteinService = proteinService; }
public void SetProteinService(IProteinService proteinService) { _proteinService = proteinService; }
private static BenchmarksModel CreateModel(IProteinService proteinService, IProteinBenchmarkService benchmarkService = null) { return(new BenchmarksModel(null, proteinService, benchmarkService, null)); }
public FrameTimeZedGraphBenchmarksReport(IProteinService proteinService, IProteinBenchmarkService benchmarkService) : base(KeyName, proteinService, benchmarkService) { }
protected ZedGraphBarGraphBenchmarksReport(string key, IProteinService proteinService, IProteinBenchmarkService benchmarkService) : base(key, proteinService, benchmarkService) { }
public ProteinDataUpdater(SQLiteConnection connection, IProteinService proteinService) : base(connection, proteinService) { }
public ProteinCalculatorModel(IPreferences preferences, IProteinService proteinService) { _preferences = preferences ?? new InMemoryPreferencesProvider(); _proteinService = proteinService ?? NullProteinService.Instance; }
public ProteinDataUpdater(IUnitInfoDatabase database, IProteinService proteinService) { if (database == null) throw new ArgumentNullException("database"); if (proteinService == null) throw new ArgumentNullException("proteinService"); _database = database; _proteinService = proteinService; Debug.Assert(_database.Connected); }
public ProjectComparisonZedGraphBenchmarksReport(IPreferences preferences, IProteinService proteinService, IProteinBenchmarkService benchmarkService) : base(KeyName, proteinService, benchmarkService) { Preferences = preferences ?? new InMemoryPreferencesProvider(); }
public UnitInfoDatabase(IPreferenceSet prefs, IProteinService proteinService, ILogger logger) { if (proteinService == null) throw new ArgumentNullException("proteinService"); _proteinService = proteinService; if (logger != null) { _logger = logger; } SQLiteFunction.RegisterFunction(typeof(ToSlotType)); SQLiteFunction.RegisterFunction(typeof(GetProduction)); ForceDateTimesToUtc = true; if (prefs != null && !String.IsNullOrEmpty(prefs.ApplicationDataFolderPath)) { DatabaseFilePath = System.IO.Path.Combine(prefs.ApplicationDataFolderPath, Constants.SqLiteFilename); } }
protected ZedGraphBenchmarksReport(string key, IProteinService proteinService, IProteinBenchmarkService benchmarkService) : base(key) { ProteinService = proteinService ?? NullProteinService.Instance; BenchmarkService = benchmarkService ?? NullProteinBenchmarkService.Instance; }
public ProteinDataUpdaterWithCancellation(SQLiteConnection connection, IProteinService proteinService) : base(connection, proteinService) { }
private static BenchmarksModel CreateModel(IProteinService proteinService, IProteinBenchmarkService benchmarkService, IEnumerable <BenchmarksReport> reports = null) { return(new BenchmarksModel(null, proteinService, benchmarkService, reports)); }
public ProteinDataUpdater(IWorkUnitDatabase database, IProteinService proteinService) : this(database, proteinService, null) { }
public ProteinDataUpdater(IWorkUnitDatabase database, IProteinService proteinService, SQLiteConnection connection) { _database = database ?? throw new ArgumentNullException(nameof(database)); _proteinService = proteinService ?? NullProteinService.Instance; _connection = connection; }