Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs =================================================================== diff -u -r8a482f64da54bd72583411ba20668c58b2ae0184 -r2c7c991c5f2f2ef73d6683daad93d07ddb73ad6c --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs (.../GrassCoverErosionInwardsPlugin.cs) (revision 8a482f64da54bd72583411ba20668c58b2ae0184) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs (.../GrassCoverErosionInwardsPlugin.cs) (revision 2c7c991c5f2f2ef73d6683daad93d07ddb73ad6c) @@ -611,37 +611,31 @@ private StrictContextMenuItem CreateUpdateDikeProfileItem(GrassCoverErosionInwardsCalculationGroupContext nodeData) { - IEnumerable calculations = nodeData.WrappedData - .GetCalculations() - .OfType(); + var contextMenuEnabled = true; + string toolTipMessage = Resources.GrassCoverErosionInwardsPlugin_CreateUpdateDikeProfileItem_Update_all_calculations_with_DikeProfile_Tooltip; + IList calculationsToUpdate = nodeData.WrappedData.GetCalculations() + .OfType() + .Where(c => c.InputParameters.DikeProfile != null && !c.InputParameters.IsDikeProfileInputSynchronized) + .ToList(); - var isContextMenuItemEnabled = true; - string toolTipText = - Resources.GrassCoverErosionInwardsPlugin_CreateUpdateDikeProfileItem_Update_all_calculations_with_DikeProfile_Tooltip; - if (!calculations.Any()) + if (!calculationsToUpdate.Any()) { - toolTipText = RingtoetsCommonFormsResources.CreateUpdateContextMenuItem_No_calculations_to_update_ToolTip; - isContextMenuItemEnabled = false; + contextMenuEnabled = false; + toolTipMessage = RingtoetsCommonFormsResources.CreateUpdateContextMenuItem_No_calculations_to_update_ToolTip; } - else if (calculations.All(calc => calc.InputParameters.DikeProfile == null)) - { - toolTipText = Resources.GrassCoverErosionInwardsPlugin_CreateUpdateDikeProfileItem_No_calculations_with_DikeProfile_ToolTip; - isContextMenuItemEnabled = false; - } return new StrictContextMenuItem(Resources.GrassCoverErosionInwardsPlugin_CreateUpdateDikeProfileItem_Update_all_DikeProfiles, - toolTipText, + toolTipMessage, RingtoetsCommonFormsResources.UpdateItemIcon, - (o, args) => UpdateDikeProfileDependentDataOfAllCalculations(calculations)) + (o, args) => UpdateDikeProfileDependentDataOfAllCalculations(calculationsToUpdate)) { - Enabled = isContextMenuItemEnabled + Enabled = contextMenuEnabled }; } - private void UpdateDikeProfileDependentDataOfAllCalculations(IEnumerable calculations) + private void UpdateDikeProfileDependentDataOfAllCalculations(IList calculations) { - string message = - Resources.GrassCoverErosionInwardsPlugin_VerifyDikeProfileUpdate_Confirm_calculation_outputs_cleared_when_updating_DikeProfile_dependent_data; + string message = RingtoetsCommonFormsResources.VerifyUpdate_Confirm_calculation_outputs_cleared; if (DikeProfileDependentDataShouldUpdate(calculations, message)) { foreach (GrassCoverErosionInwardsCalculation calculation in calculations)