Index: Ringtoets/Integration/src/Ringtoets.Integration.Service/RingtoetsDataSynchronizationService.cs
===================================================================
diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -r91d2618c244882958683e28675970ef50bbf2fe6
--- Ringtoets/Integration/src/Ringtoets.Integration.Service/RingtoetsDataSynchronizationService.cs (.../RingtoetsDataSynchronizationService.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Service/RingtoetsDataSynchronizationService.cs (.../RingtoetsDataSynchronizationService.cs) (revision 91d2618c244882958683e28675970ef50bbf2fe6)
@@ -205,7 +205,7 @@
/// Clears the output of the hydraulic boundary locations within the and the
/// hydraulic boundary locations that are contained within specific failure mechanisms of the .
///
- /// The wich contains the locations.
+ /// The which contains the locations.
/// The which contains the failure mechanisms.
/// All objects affected by the operation.
/// Thrown when any parameter is null.
@@ -582,6 +582,204 @@
return changedObservables;
}
+ ///
+ /// Removes all from the
+ /// and clears all data that depends on it, either directly or indirectly.
+ ///
+ /// The failure mechanism
+ /// containing the .
+ /// All observable objects affected by this method.
+ /// Thrown when
+ /// is null.
+ public static IEnumerable RemoveAllForeshoreProfiles(ClosingStructuresFailureMechanism failureMechanism)
+ {
+ if (failureMechanism == null)
+ {
+ throw new ArgumentNullException(nameof(failureMechanism));
+ }
+
+ IEnumerable> affectedCalculations =
+ failureMechanism.Calculations
+ .OfType>()
+ .Where(calc => calc.InputParameters.ForeshoreProfile != null);
+
+ var affectedObjects = new List();
+ foreach (StructuresCalculation calculation in affectedCalculations)
+ {
+ calculation.InputParameters.ForeshoreProfile = null;
+ affectedObjects.Add(calculation.InputParameters);
+ }
+
+ failureMechanism.ForeshoreProfiles.Clear();
+ affectedObjects.Add(failureMechanism.ForeshoreProfiles);
+ return affectedObjects;
+ }
+
+ ///
+ /// Removes all from the
+ /// and clears all data that depends on it, either directly or indirectly.
+ ///
+ /// The failure mechanism
+ /// containing the .
+ /// All observable objects affected by this method.
+ /// Thrown when
+ /// is null.
+ public static IEnumerable RemoveAllForeshoreProfiles(StabilityPointStructuresFailureMechanism failureMechanism)
+ {
+ if (failureMechanism == null)
+ {
+ throw new ArgumentNullException(nameof(failureMechanism));
+ }
+
+ IEnumerable> affectedCalculations =
+ failureMechanism.Calculations
+ .OfType>()
+ .Where(calc => calc.InputParameters.ForeshoreProfile != null);
+
+ var affectedObjects = new List();
+ foreach (StructuresCalculation calculation in affectedCalculations)
+ {
+ calculation.InputParameters.ForeshoreProfile = null;
+ affectedObjects.Add(calculation.InputParameters);
+ }
+
+ failureMechanism.ForeshoreProfiles.Clear();
+ affectedObjects.Add(failureMechanism.ForeshoreProfiles);
+ return affectedObjects;
+ }
+
+ ///
+ /// Removes all from the
+ /// and clears all data that depends on it, either directly or indirectly.
+ ///
+ /// The failure mechanism
+ /// containing the .
+ /// All observable objects affected by this method.
+ /// Thrown when
+ /// is null.
+ public static IEnumerable RemoveAllForeshoreProfiles(HeightStructuresFailureMechanism failureMechanism)
+ {
+ if (failureMechanism == null)
+ {
+ throw new ArgumentNullException(nameof(failureMechanism));
+ }
+
+ IEnumerable> affectedCalculations =
+ failureMechanism.Calculations
+ .OfType>()
+ .Where(calc => calc.InputParameters.ForeshoreProfile != null);
+
+ var affectedObjects = new List();
+ foreach (StructuresCalculation calculation in affectedCalculations)
+ {
+ calculation.InputParameters.ForeshoreProfile = null;
+ affectedObjects.Add(calculation.InputParameters);
+ }
+
+ failureMechanism.ForeshoreProfiles.Clear();
+ affectedObjects.Add(failureMechanism.ForeshoreProfiles);
+ return affectedObjects;
+ }
+
+ ///
+ /// Removes all from the
+ /// and clears all data that depends on it, either directly or indirectly.
+ ///
+ /// The failure mechanism
+ /// containing the .
+ /// All observable objects affected by this method.
+ /// Thrown when
+ /// is null.
+ public static IEnumerable RemoveAllForeshoreProfiles(GrassCoverErosionOutwardsFailureMechanism failureMechanism)
+ {
+ if (failureMechanism == null)
+ {
+ throw new ArgumentNullException(nameof(failureMechanism));
+ }
+
+ IEnumerable affectedCalculations =
+ failureMechanism.Calculations
+ .OfType()
+ .Where(calc => calc.InputParameters.ForeshoreProfile != null);
+
+ var affectedObjects = new List();
+ foreach (GrassCoverErosionOutwardsWaveConditionsCalculation calculation in affectedCalculations)
+ {
+ calculation.InputParameters.ForeshoreProfile = null;
+ affectedObjects.Add(calculation.InputParameters);
+ }
+
+ failureMechanism.ForeshoreProfiles.Clear();
+ affectedObjects.Add(failureMechanism.ForeshoreProfiles);
+ return affectedObjects;
+ }
+
+ ///
+ /// Removes all from the
+ /// and clears all data that depends on it, either directly or indirectly.
+ ///
+ /// The failure mechanism
+ /// containing the .
+ /// All observable objects affected by this method.
+ /// Thrown when
+ /// is null.
+ public static IEnumerable RemoveAllForeshoreProfiles(StabilityStoneCoverFailureMechanism failureMechanism)
+ {
+ if (failureMechanism == null)
+ {
+ throw new ArgumentNullException(nameof(failureMechanism));
+ }
+
+ IEnumerable affectedCalculations =
+ failureMechanism.Calculations
+ .OfType()
+ .Where(calc => calc.InputParameters.ForeshoreProfile != null);
+
+ var affectedObjects = new List();
+ foreach (StabilityStoneCoverWaveConditionsCalculation calculation in affectedCalculations)
+ {
+ calculation.InputParameters.ForeshoreProfile = null;
+ affectedObjects.Add(calculation.InputParameters);
+ }
+
+ failureMechanism.ForeshoreProfiles.Clear();
+ affectedObjects.Add(failureMechanism.ForeshoreProfiles);
+ return affectedObjects;
+ }
+
+ ///
+ /// Removes all from the
+ /// and clears all data that depends on it, either directly or indirectly.
+ ///
+ /// The failure mechanism
+ /// containing the .
+ /// All observable objects affected by this method.
+ /// Thrown when
+ /// is null.
+ public static IEnumerable RemoveAllForeshoreProfiles(WaveImpactAsphaltCoverFailureMechanism failureMechanism)
+ {
+ if (failureMechanism == null)
+ {
+ throw new ArgumentNullException(nameof(failureMechanism));
+ }
+
+ IEnumerable affectedCalculations =
+ failureMechanism.Calculations
+ .OfType()
+ .Where(calc => calc.InputParameters.ForeshoreProfile != null);
+
+ var affectedObjects = new List();
+ foreach (WaveImpactAsphaltCoverWaveConditionsCalculation calculation in affectedCalculations)
+ {
+ calculation.InputParameters.ForeshoreProfile = null;
+ affectedObjects.Add(calculation.InputParameters);
+ }
+
+ failureMechanism.ForeshoreProfiles.Clear();
+ affectedObjects.Add(failureMechanism.ForeshoreProfiles);
+ return affectedObjects;
+ }
+
private static ClearResults GetClearResultsForFailureMechanism(IFailureMechanism failureMechanism)
{
var pipingFailureMechanism = failureMechanism as PipingFailureMechanism;