Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs =================================================================== diff -u -r636a79efa1f104b917c48d043151ada9fc4e69ac -rbd29bacc20bc58cc67f27dd33fa4fa6b41db873c --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs (.../GrassCoverErosionInwardsGuiPlugin.cs) (revision 636a79efa1f104b917c48d043151ada9fc4e69ac) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs (.../GrassCoverErosionInwardsGuiPlugin.cs) (revision bd29bacc20bc58cc67f27dd33fa4fa6b41db873c) @@ -28,7 +28,6 @@ using System.Windows.Forms; using Core.Common.Base.Data; using Core.Common.Controls.TreeView; -using Core.Common.Gui.ContextMenu; using Core.Common.Gui.Forms.ProgressDialog; using Core.Common.Gui.Plugin; using Ringtoets.Common.Data; @@ -245,22 +244,11 @@ private ContextMenuStrip FailureMechanismEnabledContextMenuStrip(GrassCoverErosionInwardsFailureMechanismContext grassCoverErosionInwardsFailureMechanismContext, object parentData, TreeViewControl treeViewControl) { - var changeRelevancyItem = new StrictContextMenuItem( - RingtoetsCommonFormsResources.FailureMechanismContextMenuStrip_Is_relevant, - RingtoetsCommonFormsResources.FailureMechanismContextMenuStrip_Is_relevant_Tooltip, - RingtoetsCommonFormsResources.Checkbox_ticked, - (sender, args) => - { - Gui.ViewCommands.RemoveAllViewsForItem(grassCoverErosionInwardsFailureMechanismContext); - grassCoverErosionInwardsFailureMechanismContext.WrappedData.IsRelevant = false; - grassCoverErosionInwardsFailureMechanismContext.WrappedData.NotifyObservers(); - }); - var builder = new RingtoetsContextMenuBuilder(Gui.Get(grassCoverErosionInwardsFailureMechanismContext, treeViewControl)); return builder .AddOpenItem() .AddSeparator() - .AddCustomItem(changeRelevancyItem) + .AddChangeRelevancyOfFailureMechanismItem(grassCoverErosionInwardsFailureMechanismContext, RemoveAllViewsForItem) .AddSeparator() .AddPerformAllCalculationsInFailureMechanismItem(grassCoverErosionInwardsFailureMechanismContext, CalculateAll, EnablePerformAllCalculationsInFailureMechanism) .AddClearAllCalculationOutputInFailureMechanismItem(grassCoverErosionInwardsFailureMechanismContext.WrappedData) @@ -280,6 +268,11 @@ return AllDataAvailable(context.Parent, context.WrappedData); } + private void RemoveAllViewsForItem(GrassCoverErosionInwardsFailureMechanismContext failureMechanismContext) + { + Gui.ViewCommands.RemoveAllViewsForItem(failureMechanismContext); + } + private ContextMenuStrip FailureMechanismDisabledContextMenuStrip(GrassCoverErosionInwardsFailureMechanismContext grassCoverErosionInwardsFailureMechanismContext, object parentData, TreeViewControl treeViewControl) { var builder = new RingtoetsContextMenuBuilder(Gui.Get(grassCoverErosionInwardsFailureMechanismContext, treeViewControl));