Index: Riskeer/Common/src/Riskeer.Common.Forms/Views/HydraulicBoundaryCalculationsView.cs =================================================================== diff -u -rcd66114d9af655f71f133ceb542da2bf2c0693e4 -r9b5a87777197a0360236b06f01236a56067b8839 --- Riskeer/Common/src/Riskeer.Common.Forms/Views/HydraulicBoundaryCalculationsView.cs (.../HydraulicBoundaryCalculationsView.cs) (revision cd66114d9af655f71f133ceb542da2bf2c0693e4) +++ Riskeer/Common/src/Riskeer.Common.Forms/Views/HydraulicBoundaryCalculationsView.cs (.../HydraulicBoundaryCalculationsView.cs) (revision 9b5a87777197a0360236b06f01236a56067b8839) @@ -54,8 +54,11 @@ /// /// Creates a new instance of . /// + /// The calculations to show in the view. + /// The assessment section which the calculations belong to. + /// Thrown when any parameter is null. protected HydraulicBoundaryCalculationsView(IObservableEnumerable calculations, - IAssessmentSection assessmentSection) + IAssessmentSection assessmentSection) { if (calculations == null) { @@ -112,20 +115,6 @@ protected abstract void PerformSelectedCalculations(IEnumerable calculations); /// - /// Updates the data source of the data table based on the . - /// - protected void UpdateDataGridViewDataSource() - { - suspendAllEvents = true; - SetDataSource(); - illustrationPointsControl.Data = GetIllustrationPointControlItems(); - suspendAllEvents = false; - - UpdateCalculateForSelectedButton(); - ProvideCalculationSelection(); - } - - /// /// Initializes the . /// protected virtual void InitializeDataGridView() @@ -162,19 +151,30 @@ base.Dispose(disposing); } + private void UpdateDataGridViewDataSource() + { + suspendAllEvents = true; + SetDataSource(); + illustrationPointsControl.Data = GetIllustrationPointControlItems(); + suspendAllEvents = false; + + UpdateCalculateForSelectedButton(); + ProvideCalculationSelection(); + } + private IEnumerable> GetCalculatableRows() { return dataGridViewControl.Rows .Cast() .Select(row => (CalculatableRow) row.DataBoundItem); } - private IEnumerable GetSelectedCalculatableObjects() + private IEnumerable GetSelectedHydraulicBoundaryLocationCalculations() { return GetCalculatableRows().Where(r => r.ShouldCalculate) .Select(r => r.CalculatableObject); } - + private void HandleHydraulicBoundaryLocationCalculationUpdate() { suspendAllEvents = true; @@ -220,7 +220,7 @@ return; } - PerformSelectedCalculations(GetSelectedCalculatableObjects()); + PerformSelectedCalculations(GetSelectedHydraulicBoundaryLocationCalculations()); } private string ValidateCalculatableObjects()