Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsView.cs =================================================================== diff -u -r46653f17a2e39e1e69705b75d05436ac74d84aa1 -r7fdca38fd807e6f360289fd5cf7fb29ff11e897e --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsView.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsView.cs) (revision 46653f17a2e39e1e69705b75d05436ac74d84aa1) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsView.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsView.cs) (revision 7fdca38fd807e6f360289fd5cf7fb29ff11e897e) @@ -47,14 +47,20 @@ /// /// Creates a new instance of . /// + /// The locations to show in the view. /// The failure mechanism that the locations belong to. /// The assessment section that the locations belong to. - /// Thrown when or - /// is null. - public GrassCoverErosionOutwardsDesignWaterLevelLocationsView(GrassCoverErosionOutwardsFailureMechanism failureMechanism, + /// Thrown when any input parameter is null. + public GrassCoverErosionOutwardsDesignWaterLevelLocationsView(ObservableList locations, + GrassCoverErosionOutwardsFailureMechanism failureMechanism, IAssessmentSection assessmentSection) - : base(failureMechanism?.HydraulicBoundaryLocations, assessmentSection) + : base(locations, assessmentSection) { + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + FailureMechanism = failureMechanism; messageProvider = new GrassCoverErosionOutwardsDesignWaterLevelCalculationMessageProvider(); @@ -110,7 +116,7 @@ protected override string ValidateCalculatableObjects() { - return FailureMechanism != null && FailureMechanism.Contribution <= 0 + return FailureMechanism.Contribution <= 0 ? RingtoetsCommonFormsResources.Contribution_of_failure_mechanism_zero : base.ValidateCalculatableObjects(); } Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsWaveHeightLocationsView.cs =================================================================== diff -u -r46653f17a2e39e1e69705b75d05436ac74d84aa1 -r7fdca38fd807e6f360289fd5cf7fb29ff11e897e --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsWaveHeightLocationsView.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsView.cs) (revision 46653f17a2e39e1e69705b75d05436ac74d84aa1) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsWaveHeightLocationsView.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsView.cs) (revision 7fdca38fd807e6f360289fd5cf7fb29ff11e897e) @@ -47,14 +47,20 @@ /// /// Creates a new instance of . /// + /// The locations to show in the view. /// The failure mechanism that the locations belong to. /// The assessment section that the locations belong to. - /// Thrown when or - /// is null. - public GrassCoverErosionOutwardsWaveHeightLocationsView(GrassCoverErosionOutwardsFailureMechanism failureMechanism, + /// Thrown when any input parameter is null. + public GrassCoverErosionOutwardsWaveHeightLocationsView(ObservableList locations, + GrassCoverErosionOutwardsFailureMechanism failureMechanism, IAssessmentSection assessmentSection) - : base(failureMechanism?.HydraulicBoundaryLocations, assessmentSection) + : base(locations, assessmentSection) { + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + FailureMechanism = failureMechanism; messageProvider = new GrassCoverErosionOutwardsWaveHeightCalculationMessageProvider(); @@ -112,7 +118,7 @@ protected override string ValidateCalculatableObjects() { - return FailureMechanism != null && FailureMechanism.Contribution <= 0 + return FailureMechanism.Contribution <= 0 ? RingtoetsCommonFormsResources.Contribution_of_failure_mechanism_zero : base.ValidateCalculatableObjects(); } Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs =================================================================== diff -u -rdd403402744c68406685f2838f6f41e23eada5f2 -r7fdca38fd807e6f360289fd5cf7fb29ff11e897e --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision dd403402744c68406685f2838f6f41e23eada5f2) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision 7fdca38fd807e6f360289fd5cf7fb29ff11e897e) @@ -141,7 +141,9 @@ GetViewName = (view, locations) => RingtoetsGrassCoverErosionOutwardsFormsResources.GrassCoverErosionOutwardsWaterLevelLocations_DisplayName, GetViewData = context => context.WrappedData, Image = RingtoetsCommonFormsResources.GenericInputOutputIcon, - CreateInstance = context => new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(context.FailureMechanism, context.AssessmentSection), + CreateInstance = context => new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(context.WrappedData, + context.FailureMechanism, + context.AssessmentSection), AfterCreate = (view, context) => { view.CalculationGuiService = hydraulicBoundaryLocationCalculationGuiService; @@ -156,13 +158,15 @@ { GetViewName = (view, locations) => RingtoetsGrassCoverErosionOutwardsFormsResources.GrassCoverErosionOutwardsWaveHeightLocationsContext_DisplayName, GetViewData = context => context.WrappedData, - CloseForData = CloseGrassCoverErosionOutwardsLocationsViewForData, Image = RingtoetsCommonFormsResources.GenericInputOutputIcon, - CreateInstance = context => new GrassCoverErosionOutwardsWaveHeightLocationsView(context.FailureMechanism, context.AssessmentSection), + CreateInstance = context => new GrassCoverErosionOutwardsWaveHeightLocationsView(context.WrappedData, + context.FailureMechanism, + context.AssessmentSection), AfterCreate = (view, context) => { view.CalculationGuiService = hydraulicBoundaryLocationCalculationGuiService; - } + }, + CloseForData = CloseGrassCoverErosionOutwardsLocationsViewForData }; }