Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresPlugin.cs =================================================================== diff -u -r3e79015849651b140c9b496e8f0f57fcdcac0d92 -rb6f4e414fc874653cc6ad84b80f330b28e69b823 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresPlugin.cs (.../HeightStructuresPlugin.cs) (revision 3e79015849651b140c9b496e8f0f57fcdcac0d92) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresPlugin.cs (.../HeightStructuresPlugin.cs) (revision b6f4e414fc874653cc6ad84b80f330b28e69b823) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections; using System.Collections.Generic; using System.Drawing; @@ -27,6 +28,7 @@ using System.Windows.Forms; using Core.Common.Base; using Core.Common.Controls.TreeView; +using Core.Common.Gui.Commands; using Core.Common.Gui.ContextMenu; using Core.Common.Gui.Forms.ProgressDialog; using Core.Common.Gui.Plugin; @@ -52,6 +54,7 @@ using HeightStructuresFormsResources = Ringtoets.HeightStructures.Forms.Properties.Resources; using RingtoetsCommonServiceResources = Ringtoets.Common.Service.Properties.Resources; using RingtoetsCommonIOResources = Ringtoets.Common.IO.Properties.Resources; +using CoreCommonBaseResources = Core.Common.Base.Properties.Resources; namespace Ringtoets.HeightStructures.Plugin { @@ -414,7 +417,8 @@ if (!isNestedGroup) { builder.AddSeparator() - .AddRemoveAllChildrenItem(group, Gui.ViewCommands); + .AddRemoveAllChildrenItem(); +// .AddRemoveAllChildrenItem(group, Gui.ViewCommands); } builder.AddSeparator() @@ -494,6 +498,12 @@ var parentGroupContext = (HeightStructuresCalculationGroupContext) parentNodeData; parentGroupContext.WrappedData.Children.Remove(context.WrappedData); + foreach (var calculation in context.WrappedData.GetCalculations().Cast()) + { + HeightStructuresHelper.Delete(context.FailureMechanism.SectionResults, + calculation, + context.FailureMechanism.Calculations.Cast()); + } parentGroupContext.NotifyObservers(); } @@ -585,7 +595,7 @@ if (calculationGroupContext != null) { calculationGroupContext.WrappedData.Children.Remove(context.WrappedData); - HeightStructuresHelper.Delete(context.FailureMechanism.SectionResults, context.WrappedData, context.FailureMechanism.Calculations.OfType()); + HeightStructuresHelper.Delete(context.FailureMechanism.SectionResults, context.WrappedData, context.FailureMechanism.Calculations.Cast()); calculationGroupContext.NotifyObservers(); } }