private static void UpdateBenchmarkData(IProteinBenchmarkCollection benchmarkCollection, ClientEditedEventArgs e) { // the name changed if (e.PreviousName != e.NewName) { // update the Names in the benchmark collection benchmarkCollection.UpdateOwnerName(e.PreviousName, e.PreviousPath, e.NewName); } // the path changed if (!Paths.Equal(e.PreviousPath, e.NewPath)) { // update the Paths in the benchmark collection benchmarkCollection.UpdateOwnerPath(e.NewName, e.PreviousPath, e.NewPath); } }
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(); }; }
internal static void SubscribeToEvents(this IClientConfiguration configuration, IProteinBenchmarkCollection benchmarkCollection) { configuration.ClientEdited += (s, e) => UpdateBenchmarkData(benchmarkCollection, e); configuration.DictionaryChanged += (s, e) => { switch (e.ChangedType) { case ConfigurationChangedType.Add: case ConfigurationChangedType.Edit: if (e.Client != null) { Task.Factory.StartNew(e.Client.Retrieve); } break; } }; }
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 void TimePerSectionTest6() { _benchmarkCollection = null; var unitInfoLogic = CreateUnitInfoLogic(null, new UnitInfo()); unitInfoLogic.UtcOffsetIsZero = false; unitInfoLogic.ClientTimeOffset = 0; Assert.AreEqual(TimeSpan.Zero, unitInfoLogic.GetFrameTime(PpdCalculationType.LastFrame)); }
public void Init() { _benchmarkCollection = MockRepository.GenerateStub<IProteinBenchmarkCollection>(); }
public UnitInfoLogic(IProteinBenchmarkCollection benchmarkCollection) { _benchmarkCollection = benchmarkCollection; }
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(); }
public UnitInfoModel(IProteinBenchmarkCollection benchmarkCollection) { _benchmarkCollection = benchmarkCollection; }