Index: Riskeer/Common/src/Riskeer.Common.Forms/Views/HydraulicBoundaryCalculationsView.cs =================================================================== diff -u -r0d7d60aedb3d9498ba4a2aeef28c2838abd0f68a -r5728fd5e8097b89c522504eb5d5d6e4ce3a482c8 --- Riskeer/Common/src/Riskeer.Common.Forms/Views/HydraulicBoundaryCalculationsView.cs (.../HydraulicBoundaryCalculationsView.cs) (revision 0d7d60aedb3d9498ba4a2aeef28c2838abd0f68a) +++ Riskeer/Common/src/Riskeer.Common.Forms/Views/HydraulicBoundaryCalculationsView.cs (.../HydraulicBoundaryCalculationsView.cs) (revision 5728fd5e8097b89c522504eb5d5d6e4ce3a482c8) @@ -51,28 +51,8 @@ /// The assessment section which the calculations belong to. /// Thrown when any input parameter is null. protected HydraulicBoundaryCalculationsView(IObservableEnumerable calculations, - IAssessmentSection assessmentSection) + IAssessmentSection assessmentSection) : base(calculations, assessmentSection) { - if (calculations == null) - { - throw new ArgumentNullException(nameof(calculations)); - } - - if (assessmentSection == null) - { - throw new ArgumentNullException(nameof(assessmentSection)); - } - - AssessmentSection = assessmentSection; - - calculationsObserver = new Observer(UpdateDataGridViewDataSource); - calculationObserver = new RecursiveObserver, HydraulicBoundaryLocationCalculation>(HandleHydraulicBoundaryLocationCalculationUpdate, hblc => hblc); - - this.calculations = calculations; - - calculationsObserver.Observable = calculations; - calculationObserver.Observable = calculations; - UpdateDataGridViewDataSource(); } Index: Riskeer/Common/src/Riskeer.Common.Forms/Views/LocationCalculationsView.cs =================================================================== diff -u -r6e3bc0437167a40cf4a79f0f04e31dc61ef4407f -r5728fd5e8097b89c522504eb5d5d6e4ce3a482c8 --- Riskeer/Common/src/Riskeer.Common.Forms/Views/LocationCalculationsView.cs (.../LocationCalculationsView.cs) (revision 6e3bc0437167a40cf4a79f0f04e31dc61ef4407f) +++ Riskeer/Common/src/Riskeer.Common.Forms/Views/LocationCalculationsView.cs (.../LocationCalculationsView.cs) (revision 5728fd5e8097b89c522504eb5d5d6e4ce3a482c8) @@ -23,9 +23,11 @@ using System.Collections.Generic; using System.Linq; using System.Windows.Forms; +using Core.Common.Base; using Core.Common.Controls.Views; using Core.Common.Util.Extensions; using Riskeer.Common.Data.AssessmentSection; +using Riskeer.Common.Data.Hydraulics; using Riskeer.Common.Data.IllustrationPoints; using Riskeer.Common.Forms.PresentationObjects; using Riskeer.Common.Forms.Properties; @@ -41,13 +43,39 @@ private const int calculateColumnIndex = 0; private bool suspendAllEvents; private bool suspendIllustrationPointsControlSelectionChanges; + + private readonly Observer calculationsObserver; + private readonly RecursiveObserver, HydraulicBoundaryLocationCalculation> calculationObserver; + + private readonly IObservableEnumerable calculations; public event EventHandler SelectionChanged; /// /// Creates a new instance of . /// - protected LocationCalculationsView() + protected LocationCalculationsView(IObservableEnumerable calculations, + IAssessmentSection assessmentSection) { + if (calculations == null) + { + throw new ArgumentNullException(nameof(calculations)); + } + + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + + AssessmentSection = assessmentSection; + + calculationsObserver = new Observer(UpdateDataGridViewDataSource); + calculationObserver = new RecursiveObserver, HydraulicBoundaryLocationCalculation>(HandleHydraulicBoundaryLocationCalculationUpdate, hblc => hblc); + + this.calculations = calculations; + + calculationsObserver.Observable = calculations; + calculationObserver.Observable = calculations; + InitializeComponent(); LocalizeControls(); InitializeEventHandlers(); @@ -190,6 +218,7 @@ DeselectAllButton.Text = Resources.CalculatableView_DeselectAllButton_Text; SelectAllButton.Text = Resources.CalculatableView_SelectAllButton_Text; ButtonGroupBox.Text = Resources.CalculatableView_ButtonGroupBox_Text; + HideHydraulicBoundaryDatabaseColumnCheckBox.Text = Resources.LocationCalculationsView_HideHydraulicBoundaryDatabaseColumnCheckBox_Text; } private void InitializeEventHandlers()