Index: Core/Common/src/Core.Common.Gui/PropertyBag/ObjectProperties.cs =================================================================== diff -u -r0ae715fe2b16306e4147fed9749bae67ce186168 -r9a001397536d9dcca5d009c8518478cdfcddbeca --- Core/Common/src/Core.Common.Gui/PropertyBag/ObjectProperties.cs (.../ObjectProperties.cs) (revision 0ae715fe2b16306e4147fed9749bae67ce186168) +++ Core/Common/src/Core.Common.Gui/PropertyBag/ObjectProperties.cs (.../ObjectProperties.cs) (revision 9a001397536d9dcca5d009c8518478cdfcddbeca) @@ -32,7 +32,7 @@ protected T data; [Browsable(false)] - public virtual object Data + public object Data { get { Index: Ringtoets/Common/src/Ringtoets.Common.Forms/FailureMechanismPropertyChangeHandler.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Forms/FailureMechanismPropertyChangeHandler.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/FailureMechanismPropertyChangeHandler.cs (revision 9a001397536d9dcca5d009c8518478cdfcddbeca) @@ -0,0 +1,33 @@ +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; +using Core.Common.Base; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms.Properties; +using Ringtoets.Common.Forms.PropertyClasses; +using CoreCommonBaseResources = Core.Common.Base.Properties.Resources; + +namespace Ringtoets.Common.Forms +{ + public class FailureMechanismPropertyChangeHandler : IFailureMechanismPropertyChangeHandler + { + public bool ConfirmPropertyChange() + { + DialogResult result = MessageBox.Show(Resources.FailureMechanismPropertyChangeHandler_Confirm_change_composition_and_clear_dependent_data, + CoreCommonBaseResources.Confirm, + MessageBoxButtons.OKCancel); + return result == DialogResult.OK; + } + + public IEnumerable PropertyChanged(IFailureMechanism failureMechanism) + { + var affected = new List(); + foreach (var calculation in failureMechanism.Calculations.Where(c => c.HasOutput)) + { + affected.Add(calculation); + calculation.ClearOutput(); + } + return affected; + } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -rd56bec747401ad6676fac64af5eef6d5fd89c47c -r9a001397536d9dcca5d009c8518478cdfcddbeca --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision d56bec747401ad6676fac64af5eef6d5fd89c47c) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 9a001397536d9dcca5d009c8518478cdfcddbeca) @@ -913,6 +913,18 @@ } /// + /// Looks up a localized string similar to Als u een parameter in een toetsspoor wijzigt, zal de uitvoer van alle berekeningen in dit toetsspoor verwijderd worden. + /// + ///Weet u zeker dat u wilt doorgaan?. + /// + public static string FailureMechanismPropertyChangeHandler_Confirm_change_composition_and_clear_dependent_data { + get { + return ResourceManager.GetString("FailureMechanismPropertyChangeHandler_Confirm_change_composition_and_clear_depend" + + "ent_data", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Alle berekeningen voor dit vak moeten een geldige uitkomst hebben.. /// public static string FailureMechanismResultView_DataGridViewCellFormatting_All_calculations_must_have_valid_output { Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx =================================================================== diff -u -rd56bec747401ad6676fac64af5eef6d5fd89c47c -r9a001397536d9dcca5d009c8518478cdfcddbeca --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision d56bec747401ad6676fac64af5eef6d5fd89c47c) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision 9a001397536d9dcca5d009c8518478cdfcddbeca) @@ -895,4 +895,9 @@ Betrouwbaarheidsindex doelkans [-] + + Als u een parameter in een toetsspoor wijzigt, zal de uitvoer van alle berekeningen in dit toetsspoor verwijderd worden. + +Weet u zeker dat u wilt doorgaan? + \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/IFailureMechanismPropertyChangeHandler.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/IFailureMechanismPropertyChangeHandler.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/IFailureMechanismPropertyChangeHandler.cs (revision 9a001397536d9dcca5d009c8518478cdfcddbeca) @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using Core.Common.Base; +using Ringtoets.Common.Data.FailureMechanism; + +namespace Ringtoets.Common.Forms.PropertyClasses +{ + /// + /// Interface for an object that can properly handle data model changes due to a change of a + /// failure mechanism property. + /// + + public interface IFailureMechanismPropertyChangeHandler + { + /// + /// Checks to see if the replacement of the norm variable of the assessment section + /// should occur or not. + /// + /// true if the change should occur, false otherwise. + bool ConfirmPropertyChange(); + + /// + /// propagates the necessary changes to underlying data structure when a property has + /// been changed for a failure mechanism. + /// + /// The section to be updated. + /// All objects that have been affected by the change. + /// Thrown when + /// is null. + IEnumerable PropertyChanged(IFailureMechanism failureMechanism); + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj =================================================================== diff -u -r23d1e296e2da4364fbfe346e68d582dfcf966bb0 -r9a001397536d9dcca5d009c8518478cdfcddbeca --- Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision 23d1e296e2da4364fbfe346e68d582dfcf966bb0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision 9a001397536d9dcca5d009c8518478cdfcddbeca) @@ -45,6 +45,7 @@ Properties\GlobalAssembly.cs + @@ -66,6 +67,7 @@ + Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextProperties.cs =================================================================== diff -u -r5b7a6432b888a0d8cfa74bf9ee81c90ad534b76e -r9a001397536d9dcca5d009c8518478cdfcddbeca --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextProperties.cs (.../GrassCoverErosionInwardsFailureMechanismContextProperties.cs) (revision 5b7a6432b888a0d8cfa74bf9ee81c90ad534b76e) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextProperties.cs (.../GrassCoverErosionInwardsFailureMechanismContextProperties.cs) (revision 9a001397536d9dcca5d009c8518478cdfcddbeca) @@ -20,6 +20,7 @@ // All rights reserved. using System.ComponentModel; +using Core.Common.Base; using Core.Common.Gui.Attributes; using Core.Common.Gui.PropertyBag; using Core.Common.Utils.Attributes; @@ -35,6 +36,7 @@ /// public class GrassCoverErosionInwardsFailureMechanismContextProperties : ObjectProperties { + private readonly IFailureMechanismPropertyChangeHandler propertyChangeHandler; private const int namePropertyIndex = 1; private const int codePropertyIndex = 2; private const int lengthEffectPropertyIndex = 3; @@ -43,6 +45,19 @@ private const int fnFactorPropertyIndex = 6; private const int fshallowModelFactorPropertyIndex = 7; + /// + /// Creates a new instance of . + /// + /// The instance to show the properties of. + /// Handler responsible for handling effects of a property change. + public GrassCoverErosionInwardsFailureMechanismContextProperties( + GrassCoverErosionInwardsFailureMechanismContext data, + IFailureMechanismPropertyChangeHandler propertyChangeHandler) + { + Data = data; + this.propertyChangeHandler = propertyChangeHandler; + } + #region Length effect parameters [PropertyOrder(lengthEffectPropertyIndex)] @@ -57,8 +72,18 @@ } set { - data.WrappedData.GeneralInput.N = value; - data.WrappedData.NotifyObservers(); + + if (propertyChangeHandler.ConfirmPropertyChange()) + { + data.WrappedData.GeneralInput.N = value; + + var changedObjects = propertyChangeHandler.PropertyChanged(data.WrappedData); + foreach (IObservable changedObject in changedObjects) + { + changedObject.NotifyObservers(); + } + data.WrappedData.NotifyObservers(); + } } } Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs =================================================================== diff -u -r2b558b587da934f1088d35ec696ac5ab3bcedb81 -r9a001397536d9dcca5d009c8518478cdfcddbeca --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs (.../GrassCoverErosionInwardsPlugin.cs) (revision 2b558b587da934f1088d35ec696ac5ab3bcedb81) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs (.../GrassCoverErosionInwardsPlugin.cs) (revision 9a001397536d9dcca5d009c8518478cdfcddbeca) @@ -32,6 +32,7 @@ using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.Common.Data.Probability; +using Ringtoets.Common.Forms; using Ringtoets.Common.Forms.Helpers; using Ringtoets.Common.Forms.PresentationObjects; using Ringtoets.Common.Forms.TreeNodeInfos; @@ -56,7 +57,10 @@ { public override IEnumerable GetPropertyInfos() { - yield return new PropertyInfo(); + yield return new PropertyInfo + { + CreateInstance = context => new GrassCoverErosionInwardsFailureMechanismContextProperties(context, new FailureMechanismPropertyChangeHandler()) + }; yield return new PropertyInfo(); yield return new PropertyInfo(); yield return new PropertyInfo(); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextPropertiesTest.cs =================================================================== diff -u -r5c5df51bc14a7e25692abf1db5a7476e5036b13f -r9a001397536d9dcca5d009c8518478cdfcddbeca --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextPropertiesTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextPropertiesTest.cs) (revision 5c5df51bc14a7e25692abf1db5a7476e5036b13f) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextPropertiesTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextPropertiesTest.cs) (revision 9a001397536d9dcca5d009c8518478cdfcddbeca) @@ -20,12 +20,13 @@ // All rights reserved. using System.ComponentModel; +using System.Linq; using Core.Common.Base; -using Core.Common.Gui.PropertyBag; using Core.Common.TestUtil; using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Forms.PropertyClasses; using Ringtoets.GrassCoverErosionInwards.Data; using Ringtoets.GrassCoverErosionInwards.Data.Properties; using Ringtoets.GrassCoverErosionInwards.Forms.PresentationObjects; @@ -54,27 +55,18 @@ [Test] public void Constructor_ExpectedValues() { - // Call - var properties = new GrassCoverErosionInwardsFailureMechanismContextProperties(); - - // Assert - Assert.IsInstanceOf>(properties); - Assert.IsNull(properties.Data); - } - - [Test] - public void Data_SetNewFailureMechanismContextInstance_ReturnCorrectPropertyValues() - { // Setup var assessmentSectionMock = mockRepository.StrictMock(); + var handler = CreateSimpleHandler(); + mockRepository.ReplayAll(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var properties = new GrassCoverErosionInwardsFailureMechanismContextProperties(); + var properties = new GrassCoverErosionInwardsFailureMechanismContextProperties( + new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock), + handler + ); - // Call - properties.Data = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock); - // Assert Assert.AreEqual(Resources.GrassCoverErosionInwardsFailureMechanism_DisplayName, properties.Name); Assert.AreEqual(Resources.GrassCoverErosionInwardsFailureMechanism_DisplayCode, properties.Code); @@ -100,17 +92,18 @@ { // Setup var observerMock = mockRepository.StrictMock(); + var handler = CreateSimpleHandler(); int numberOfChangedProperties = 1; observerMock.Expect(o => o.UpdateObserver()).Repeat.Times(numberOfChangedProperties); var assessmentSectionMock = mockRepository.StrictMock(); mockRepository.ReplayAll(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); failureMechanism.Attach(observerMock); - var properties = new GrassCoverErosionInwardsFailureMechanismContextProperties - { - Data = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock) - }; + var properties = new GrassCoverErosionInwardsFailureMechanismContextProperties( + new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock), + handler + ); const int newLengthEffect = 10; // Call @@ -126,15 +119,16 @@ { // Setup var assessmentSectionMock = mockRepository.StrictMock(); + var handler = CreateSimpleHandler(); mockRepository.ReplayAll(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); // Call - var properties = new GrassCoverErosionInwardsFailureMechanismContextProperties - { - Data = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock) - }; + var properties = new GrassCoverErosionInwardsFailureMechanismContextProperties( + new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock), + handler + ); // Assert var generalCategory = "Algemeen"; @@ -198,5 +192,14 @@ mockRepository.VerifyAll(); } + + private IFailureMechanismPropertyChangeHandler CreateSimpleHandler() + { + var handler = mockRepository.Stub(); + handler.Stub(h => h.ConfirmPropertyChange()).Return(true); + handler.Stub(h => h.PropertyChanged(Arg.Matches(z => true))).Return(Enumerable.Empty()); + + return handler; + } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/PropertyInfos/GrassCoverErosionInwardsFailureMechanismContextPropertyInfoTest.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/PropertyInfos/GrassCoverErosionInwardsFailureMechanismContextPropertyInfoTest.cs (revision 0) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/PropertyInfos/GrassCoverErosionInwardsFailureMechanismContextPropertyInfoTest.cs (revision 9a001397536d9dcca5d009c8518478cdfcddbeca) @@ -0,0 +1,80 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Linq; +using Core.Common.Gui.Plugin; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.GrassCoverErosionInwards.Forms.PresentationObjects; +using Ringtoets.GrassCoverErosionInwards.Forms.PropertyClasses; + +namespace Ringtoets.GrassCoverErosionInwards.Plugin.Test.PropertyInfos +{ + [TestFixture] + public class GrassCoverErosionInwardsFailureMechanismContextPropertyInfoTest + { + private GrassCoverErosionInwardsPlugin plugin; + private PropertyInfo info; + + [SetUp] + public void SetUp() + { + plugin = new GrassCoverErosionInwardsPlugin(); + info = plugin.GetPropertyInfos().First(tni => tni.PropertyObjectType == typeof(GrassCoverErosionInwardsFailureMechanismContextProperties)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual(typeof(GrassCoverErosionInwardsFailureMechanismContext), info.DataType); + Assert.AreEqual(typeof(GrassCoverErosionInwardsFailureMechanismContextProperties), info.PropertyObjectType); + } + + [Test] + public void CreateInstance_Always_SetsFailureMechanismContributionAsData() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.StrictMock(); + mocks.ReplayAll(); + + var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); + var context = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); + + // Call + var objectProperties = info.CreateInstance(context); + + // Assert + Assert.AreSame(context, objectProperties.Data); + + mocks.VerifyAll(); + } + } +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/Ringtoets.GrassCoverErosionInwards.Plugin.Test.csproj =================================================================== diff -u -r23d1e296e2da4364fbfe346e68d582dfcf966bb0 -r9a001397536d9dcca5d009c8518478cdfcddbeca --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/Ringtoets.GrassCoverErosionInwards.Plugin.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.Plugin.Test.csproj) (revision 23d1e296e2da4364fbfe346e68d582dfcf966bb0) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/Ringtoets.GrassCoverErosionInwards.Plugin.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.Plugin.Test.csproj) (revision 9a001397536d9dcca5d009c8518478cdfcddbeca) @@ -67,6 +67,7 @@ + Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/IAssessmentSectionCompositionChangeHandler.cs =================================================================== diff -u --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/IAssessmentSectionCompositionChangeHandler.cs (revision 0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/IAssessmentSectionCompositionChangeHandler.cs (revision 9a001397536d9dcca5d009c8518478cdfcddbeca) @@ -0,0 +1,52 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Base; +using Ringtoets.Common.Data.AssessmentSection; + +namespace Ringtoets.Integration.Forms.PropertyClasses +{ + /// + /// Interface for an object that can properly change the + /// of an . + /// + public interface IAssessmentSectionCompositionChangeHandler + { + /// + /// Checks to see if the replacement of the assessment section composition should occur or not. + /// + /// true if the change should occur, false otherwise. + bool ConfirmCompositionChange(); + + /// + /// Replaces the of the + /// and propagates the changes to underlying data structure. + /// + /// The section to be updated. + /// The new composition value. + /// All objects that have been affected by the change. + /// Thrown when + /// is null. + IEnumerable ChangeComposition(IAssessmentSection assessmentSection, AssessmentSectionComposition newComposition); + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/IFailureMechanismContributionNormChangeHandler.cs =================================================================== diff -u --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/IFailureMechanismContributionNormChangeHandler.cs (revision 0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/IFailureMechanismContributionNormChangeHandler.cs (revision 9a001397536d9dcca5d009c8518478cdfcddbeca) @@ -0,0 +1,56 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Base; +using Ringtoets.Common.Data.AssessmentSection; + +namespace Ringtoets.Integration.Forms.PropertyClasses +{ + /// + /// Interface for an object that can properly change the + /// of an . + /// + public interface IFailureMechanismContributionNormChangeHandler + { + /// + /// Checks to see if the replacement of the norm variable of the assessment section + /// should occur or not. + /// + /// true if the change should occur, false otherwise. + bool ConfirmNormChange(); + + /// + /// Replaces the of the + /// of the given and propagates the changes to + /// underlying data structure. + /// + /// The section to be updated. + /// The new norm value. + /// All objects that have been affected by the change. + /// Thrown when + /// is null. + /// Thrown when + /// is an invalid norm value. + IEnumerable ChangeNorm(IAssessmentSection assessmentSection, double newNormValue); + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj =================================================================== diff -u -r23d1e296e2da4364fbfe346e68d582dfcf966bb0 -r9a001397536d9dcca5d009c8518478cdfcddbeca --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 23d1e296e2da4364fbfe346e68d582dfcf966bb0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 9a001397536d9dcca5d009c8518478cdfcddbeca) @@ -98,8 +98,8 @@ DesignWaterLevelLocationsView.cs - - + + Fisheye: Tag 9a001397536d9dcca5d009c8518478cdfcddbeca refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/IAssessmentSectionCompositionChangeHandler.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 9a001397536d9dcca5d009c8518478cdfcddbeca refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/IFailureMechanismContributionNormChangeHandler.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/AssessmentSectionCompositionChangeHandler.cs =================================================================== diff -u -r4fda2f3f6be17051ed305f0ea2d1b15fa87fc55f -r9a001397536d9dcca5d009c8518478cdfcddbeca --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/AssessmentSectionCompositionChangeHandler.cs (.../AssessmentSectionCompositionChangeHandler.cs) (revision 4fda2f3f6be17051ed305f0ea2d1b15fa87fc55f) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/AssessmentSectionCompositionChangeHandler.cs (.../AssessmentSectionCompositionChangeHandler.cs) (revision 9a001397536d9dcca5d009c8518478cdfcddbeca) @@ -27,6 +27,7 @@ using log4net; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Integration.Data; +using Ringtoets.Integration.Forms.PropertyClasses; using Ringtoets.Integration.Forms.Views; using Ringtoets.Integration.Plugin.Properties; using Ringtoets.Integration.Service; Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/FailureMechanismContributionNormChangeHandler.cs =================================================================== diff -u -ra1bfcaebf502a6dca18c0256d692e8c94130327a -r9a001397536d9dcca5d009c8518478cdfcddbeca --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/FailureMechanismContributionNormChangeHandler.cs (.../FailureMechanismContributionNormChangeHandler.cs) (revision a1bfcaebf502a6dca18c0256d692e8c94130327a) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/FailureMechanismContributionNormChangeHandler.cs (.../FailureMechanismContributionNormChangeHandler.cs) (revision 9a001397536d9dcca5d009c8518478cdfcddbeca) @@ -28,7 +28,7 @@ using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Contribution; using Ringtoets.GrassCoverErosionOutwards.Data; -using Ringtoets.Integration.Forms.Views; +using Ringtoets.Integration.Forms.PropertyClasses; using Ringtoets.Integration.Plugin.Properties; using Ringtoets.Integration.Service; using CoreCommonBaseResources = Core.Common.Base.Properties.Resources; Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Handlers/FailureMechanismContributionNormChangeHandlerTest.cs =================================================================== diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r9a001397536d9dcca5d009c8518478cdfcddbeca --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Handlers/FailureMechanismContributionNormChangeHandlerTest.cs (.../FailureMechanismContributionNormChangeHandlerTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Handlers/FailureMechanismContributionNormChangeHandlerTest.cs (.../FailureMechanismContributionNormChangeHandlerTest.cs) (revision 9a001397536d9dcca5d009c8518478cdfcddbeca) @@ -29,7 +29,7 @@ using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Integration.Data; -using Ringtoets.Integration.Forms.Views; +using Ringtoets.Integration.Forms.PropertyClasses; using Ringtoets.Integration.Plugin.Handlers; using Ringtoets.Integration.Service; using Ringtoets.Integration.TestUtils;