Index: Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/RingtoetsContextMenuItemFactory.cs
===================================================================
diff -u -rd08c15413bbb6009c6da8ee05833a4c3531b358c -rc73100fd8408a2865d6fb32bd17608502686b605
--- Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/RingtoetsContextMenuItemFactory.cs (.../RingtoetsContextMenuItemFactory.cs) (revision d08c15413bbb6009c6da8ee05833a4c3531b358c)
+++ Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/RingtoetsContextMenuItemFactory.cs (.../RingtoetsContextMenuItemFactory.cs) (revision c73100fd8408a2865d6fb32bd17608502686b605)
@@ -135,27 +135,26 @@
/// in a calculation group.
///
/// The type of the calculation group context.
- /// The calculation group to validate all calculations for.
/// The calculation group context belonging to the calculation group.
/// The action that validates all calculations.
/// The function which determines whether the item should be enabled. If the
- /// item should not be enabled, then the reason for that should be returned by the function and will be shown as a tooltip.
- /// If the item should be enabled then the function should return a null or empty string.
+ /// item should not be enabled, then the reason for that should be returned by the function and will be shown as a tooltip.
+ /// If the item should be enabled then the function should return a null or empty string.
/// The created .
public static StrictContextMenuItem CreateValidateAllCalculationsInGroupItem(
- CalculationGroup calculationGroup,
- TCalculationContext calculationGroupContext,
- Action validateAllAction,
+ TCalculationContext calculationGroupContext,
+ Action validateAllAction,
Func enableMenuItemFunction)
where TCalculationContext : ICalculationContext
{
+ CalculationGroup calculationGroup = calculationGroupContext.WrappedData;
var menuItem = new StrictContextMenuItem(
Resources.Validate_all,
Resources.CalculationGroup_Validate_all_ToolTip,
Resources.ValidateAllIcon,
- (o, args) => validateAllAction(calculationGroup, calculationGroupContext));
+ (o, args) => validateAllAction(calculationGroupContext));
- if (!calculationGroupContext.WrappedData.GetCalculations().Any())
+ if (!calculationGroup.GetCalculations().Any())
{
menuItem.Enabled = false;
menuItem.ToolTipText = Resources.ValidateAll_No_calculations_to_validate;
@@ -201,18 +200,18 @@
///
/// Creates a which is bound to the action of validating the input of a calculation.
///
- /// The type of the calculation.
- /// The calculation to validate.
+ /// The type of the calculation context.
+ /// The context containing the calculation to validate.
/// The action that performs the validation.
/// The function which determines whether the item should be enabled. If the
/// item should not be enabled, then the reason for that should be returned by the function and will be shown as a tooltip.
/// If the item should be enabled then the function should return a null or empty string.
/// The created .
- public static StrictContextMenuItem CreateValidateCalculationItem(
- TCalculation calculation,
- Action validateAction,
- Func enableMenuItemFunction)
- where TCalculation : ICalculation
+ public static StrictContextMenuItem CreateValidateCalculationItem(
+ TCalculationContext calculation,
+ Action validateAction,
+ Func enableMenuItemFunction)
+ where TCalculationContext : ICalculationContext
{
var menuItem = new StrictContextMenuItem(
Resources.Validate,
@@ -306,26 +305,26 @@
///
/// Creates a which is bound to the action of performing all calculations in a failure mechanism.
///
- /// The type of the failure mechanism.
+ /// The type of the failure mechanism.
/// The failure mechanism to validate the calculations of.
/// The action that validates all calculations.
/// The function which determines whether the item should be enabled. If the
/// item should not be enabled, then the reason for that should be returned by the function and will be shown as a tooltip.
/// If the item should be enabled then the function should return a null or empty string.
/// The created .
- public static StrictContextMenuItem CreateValidateAllCalculationsInFailureMechanismItem(
- TFailureMechanism failureMechanism,
- Action validateAllAction,
- Func enableMenuItemFunction)
- where TFailureMechanism : IFailureMechanism
+ public static StrictContextMenuItem CreateValidateAllCalculationsInFailureMechanismItem(
+ TFailureMechanismContext failureMechanism,
+ Action validateAllAction,
+ Func enableMenuItemFunction)
+ where TFailureMechanismContext : IFailureMechanismContext
{
var menuItem = new StrictContextMenuItem(
Resources.Validate_all,
Resources.FailureMechanism_Validate_all_ToolTip,
Resources.ValidateAllIcon,
(o, args) => validateAllAction(failureMechanism));
- if (!failureMechanism.Calculations.Any())
+ if (!failureMechanism.WrappedData.Calculations.Any())
{
menuItem.Enabled = false;
menuItem.ToolTipText = Resources.ValidateAll_No_calculations_to_validate;