Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Views/DuneLocationCalculationsView.cs =================================================================== diff -u -rf727dddbab1341efc114b1f0fe590bd683fc2356 -r8fe9bd87da92837297afa5cc804ccdac8b64900d --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Views/DuneLocationCalculationsView.cs (.../DuneLocationCalculationsView.cs) (revision f727dddbab1341efc114b1f0fe590bd683fc2356) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Views/DuneLocationCalculationsView.cs (.../DuneLocationCalculationsView.cs) (revision 8fe9bd87da92837297afa5cc804ccdac8b64900d) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using Core.Common.Base; @@ -38,23 +37,23 @@ /// public partial class DuneLocationCalculationsView : DuneLocationCalculationsViewBase { - private readonly Observer duneLocationsObserver; private readonly Observer failureMechanismObserver; + private readonly Observer duneLocationCalculationsObserver; private readonly IObservableEnumerable calculations; private readonly Func getNormFunc; - private readonly RecursiveObserver, DuneLocationCalculation> duneLocationObserver; + private readonly RecursiveObserver, DuneLocationCalculation> duneLocationCalculationObserver; /// /// Creates a new instance of . /// - /// The calculations to show in the view + /// The calculations to show in the view. /// The failure mechanism which the calculations belong to. /// The assessment section which the calculations belong to. /// for getting the norm to use during calculations. /// Thrown when any parameter is null. public DuneLocationCalculationsView(IObservableEnumerable calculations, DuneErosionFailureMechanism failureMechanism, - IAssessmentSection assessmentSection, + IAssessmentSection assessmentSection, Func getNormFunc) { if (calculations == null) @@ -84,11 +83,11 @@ FailureMechanism = failureMechanism; AssessmentSection = assessmentSection; - duneLocationsObserver = new Observer(UpdateDataGridViewDataSource) + duneLocationCalculationsObserver = new Observer(UpdateDataGridViewDataSource) { Observable = calculations }; - duneLocationObserver = new RecursiveObserver, DuneLocationCalculation>(dataGridViewControl.RefreshDataGridView, list => list) + duneLocationCalculationObserver = new RecursiveObserver, DuneLocationCalculation>(dataGridViewControl.RefreshDataGridView, list => list) { Observable = calculations }; @@ -109,7 +108,7 @@ /// /// Gets the for which the - /// locations are shown. + /// calculations are shown. /// public DuneErosionFailureMechanism FailureMechanism { get; } @@ -121,8 +120,8 @@ protected override void Dispose(bool disposing) { - duneLocationsObserver.Dispose(); - duneLocationObserver.Dispose(); + duneLocationCalculationsObserver.Dispose(); + duneLocationCalculationObserver.Dispose(); failureMechanismObserver.Dispose(); base.Dispose(disposing); @@ -166,8 +165,10 @@ { if (CalculationGuiService != null) { - IEnumerable selectedCalculations = GetSelectedCalculatableObjects(); - HandleCalculateSelectedLocations(selectedCalculations); + CalculationGuiService.Calculate(GetSelectedCalculatableObjects(), + AssessmentSection.HydraulicBoundaryDatabase.FilePath, + AssessmentSection.HydraulicBoundaryDatabase.EffectivePreprocessorDirectory(), + getNormFunc()); } } @@ -180,13 +181,5 @@ return base.ValidateCalculatableObjects(); } - - private void HandleCalculateSelectedLocations(IEnumerable calculations) - { - CalculationGuiService.Calculate(calculations, - AssessmentSection.HydraulicBoundaryDatabase.FilePath, - AssessmentSection.HydraulicBoundaryDatabase.EffectivePreprocessorDirectory(), - getNormFunc()); - } } } \ No newline at end of file