Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/PropertyClasses/WaveConditionsInputContextProperties.cs
===================================================================
diff -u -r68953cc654409e65478d6aa4fb8c1cf44b116d9d -rc48f16746209f799f93c6fc79a5202a9e3fd419f
--- Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/PropertyClasses/WaveConditionsInputContextProperties.cs (.../WaveConditionsInputContextProperties.cs) (revision 68953cc654409e65478d6aa4fb8c1cf44b116d9d)
+++ Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/PropertyClasses/WaveConditionsInputContextProperties.cs (.../WaveConditionsInputContextProperties.cs) (revision c48f16746209f799f93c6fc79a5202a9e3fd419f)
@@ -19,10 +19,12 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
+using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing.Design;
using System.Linq;
+using Core.Common.Base;
using Core.Common.Base.Data;
using Core.Common.Base.Geometry;
using Core.Common.Gui.Attributes;
@@ -35,6 +37,7 @@
using Ringtoets.Common.Forms.PresentationObjects;
using Ringtoets.Common.Forms.PropertyClasses;
using Ringtoets.Common.Forms.UITypeEditors;
+using Ringtoets.Common.Service;
using Ringtoets.Revetment.Data;
using Ringtoets.Revetment.Forms.PresentationObjects;
using Ringtoets.Revetment.Forms.Properties;
@@ -68,6 +71,19 @@
private const int foreshoreGeometryPropertyIndex = 13;
private const int revetmentTypePropertyIndex = 14;
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The for which the properties are shown.
+ protected WaveConditionsInputContextProperties(T context)
+ {
+ if (context == null)
+ {
+ throw new ArgumentNullException("context");
+ }
+ Data = context;
+ }
+
[PropertyOrder(assessmentLevelPropertyIndex)]
[ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_HydraulicData")]
[ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), "AssessmentLevel_DisplayName")]
@@ -105,7 +121,7 @@
set
{
data.WrappedData.UpperBoundaryRevetment = value;
- data.WrappedData.NotifyObservers();
+ ClearOutputAndNotifyPropertyChanged();
}
}
@@ -122,7 +138,7 @@
set
{
data.WrappedData.LowerBoundaryRevetment = value;
- data.WrappedData.NotifyObservers();
+ ClearOutputAndNotifyPropertyChanged();
}
}
@@ -139,7 +155,7 @@
set
{
data.WrappedData.UpperBoundaryWaterLevels = value;
- data.WrappedData.NotifyObservers();
+ ClearOutputAndNotifyPropertyChanged();
}
}
@@ -156,7 +172,7 @@
set
{
data.WrappedData.LowerBoundaryWaterLevels = value;
- data.WrappedData.NotifyObservers();
+ ClearOutputAndNotifyPropertyChanged();
}
}
@@ -174,7 +190,7 @@
set
{
data.WrappedData.StepSize = value;
- data.WrappedData.NotifyObservers();
+ ClearOutputAndNotifyPropertyChanged();
}
}
@@ -219,7 +235,7 @@
set
{
data.WrappedData.Orientation = value;
- data.WrappedData.NotifyObservers();
+ ClearOutputAndNotifyPropertyChanged();
}
}
@@ -271,7 +287,7 @@
set
{
data.WrappedData.ForeshoreProfile = value;
- data.WrappedData.NotifyObservers();
+ ClearOutputAndNotifyPropertyChanged();
}
}
@@ -292,13 +308,13 @@
set
{
data.WrappedData.HydraulicBoundaryLocation = value.HydraulicBoundaryLocation;
- data.WrappedData.NotifyObservers();
+ ClearOutputAndNotifyPropertyChanged();
}
}
void UseBreakWaterProperties.IChangeHandler.PropertyChanged()
{
- // TODO WTI-969/WTI-970/WTI-971
+ ClearCalculationOutput();
}
public virtual IEnumerable GetAvailableForeshoreProfiles()
@@ -311,5 +327,20 @@
return SelectableHydraulicBoundaryLocationHelper.GetSortedSelectableHydraulicBoundaryLocations(
data.HydraulicBoundaryLocations, WorldReferencePoint);
}
+
+ private void ClearOutputAndNotifyPropertyChanged()
+ {
+ ClearCalculationOutput();
+ data.WrappedData.NotifyObservers();
+ }
+
+ private void ClearCalculationOutput()
+ {
+ IEnumerable affectedCalculation = RingtoetsCommonDataSynchronizationService.ClearCalculationOutput(data.Calculation);
+ foreach (var calculation in affectedCalculation)
+ {
+ calculation.NotifyObservers();
+ }
+ }
}
}
\ No newline at end of file