Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/HydraulicBoundaryLocationsView.cs =================================================================== diff -u -r67c8fe9ab0be6c2d723c3c5d43b3ea9f6e0de706 -r338e01eab497adc6929db92e28fdfc931bdf8223 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/HydraulicBoundaryLocationsView.cs (.../HydraulicBoundaryLocationsView.cs) (revision 67c8fe9ab0be6c2d723c3c5d43b3ea9f6e0de706) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/HydraulicBoundaryLocationsView.cs (.../HydraulicBoundaryLocationsView.cs) (revision 338e01eab497adc6929db92e28fdfc931bdf8223) @@ -33,52 +33,44 @@ namespace Ringtoets.Common.Forms.Views { /// - /// Base view for views which should be derived in + /// Base view for views which should be derived in /// order to get a consistent look and feel. /// - public abstract partial class HydraulicBoundaryLocationsView : LocationsView + public abstract partial class HydraulicBoundaryLocationsView : LocationsView { - private readonly Observer hydraulicBoundaryLocationsObserver; - private readonly ObservableList locations; - private readonly RecursiveObserver, HydraulicBoundaryLocation> hydraulicBoundaryLocationObserver; + private readonly Observer calculationsObserver; + private readonly RecursiveObserver, HydraulicBoundaryLocationCalculation> calculationObserver; + private readonly ObservableList calculations; + /// /// Creates a new instance of . /// - /// The locations to show in the view. - /// for obtaining a - /// based on . - /// The assessment section which the locations belong to. + /// The calculations to show in the view. + /// The assessment section which the calculations belong to. /// Thrown when any input parameter is null. - protected HydraulicBoundaryLocationsView(ObservableList locations, - Func getCalculationFunc, + protected HydraulicBoundaryLocationsView(ObservableList calculations, IAssessmentSection assessmentSection) { - if (locations == null) + if (calculations == null) { - throw new ArgumentNullException(nameof(locations)); + throw new ArgumentNullException(nameof(calculations)); } - if (getCalculationFunc == null) - { - throw new ArgumentNullException(nameof(getCalculationFunc)); - } - if (assessmentSection == null) { throw new ArgumentNullException(nameof(assessmentSection)); } AssessmentSection = assessmentSection; - hydraulicBoundaryLocationsObserver = new Observer(UpdateDataGridViewDataSource); - hydraulicBoundaryLocationObserver = new RecursiveObserver, HydraulicBoundaryLocation>(HandleHydraulicBoundaryLocationCalculationUpdate, list => list); + calculationsObserver = new Observer(UpdateDataGridViewDataSource); + calculationObserver = new RecursiveObserver, HydraulicBoundaryLocationCalculation>(HandleHydraulicBoundaryLocationCalculationUpdate, list => list); - this.locations = locations; - GetCalculationFunc = getCalculationFunc; + this.calculations = calculations; - hydraulicBoundaryLocationsObserver.Observable = locations; - hydraulicBoundaryLocationObserver.Observable = locations; + calculationsObserver.Observable = calculations; + calculationObserver.Observable = calculations; UpdateDataGridViewDataSource(); } @@ -90,23 +82,18 @@ /// public IHydraulicBoundaryLocationCalculationGuiService CalculationGuiService { get; set; } - /// - /// Gets the for obtaining a - /// based on . - /// - protected Func GetCalculationFunc { get; } - protected override void Dispose(bool disposing) { - hydraulicBoundaryLocationsObserver.Dispose(); - hydraulicBoundaryLocationObserver.Dispose(); + calculationsObserver.Dispose(); + calculationObserver.Dispose(); base.Dispose(disposing); } protected override void InitializeDataGridView() { base.InitializeDataGridView(); + dataGridViewControl.AddCheckBoxColumn(nameof(HydraulicBoundaryLocationRow.IncludeIllustrationPoints), RingtoetsCommonFormsResources.HydraulicBoundaryLocationCalculationInput_IncludeIllustrationPoints_DisplayName); dataGridViewControl.AddTextBoxColumn(nameof(HydraulicBoundaryLocationRow.Name), @@ -136,7 +123,7 @@ protected override void SetDataSource() { - dataGridViewControl.SetDataSource(locations?.Select(CreateNewRow).ToArray()); + dataGridViewControl.SetDataSource(calculations?.Select(CreateNewRow).ToArray()); } protected override IEnumerable GetIllustrationPointControlItems()