Index: Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/RingtoetsContextMenuBuilder.cs =================================================================== diff -u -re2991a38a1982398a6cbb35e38e534e26ba8930d -r44c71f7b8e6dfd00e7239d418ff19794faa2bad1 --- Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/RingtoetsContextMenuBuilder.cs (.../RingtoetsContextMenuBuilder.cs) (revision e2991a38a1982398a6cbb35e38e534e26ba8930d) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/RingtoetsContextMenuBuilder.cs (.../RingtoetsContextMenuBuilder.cs) (revision 44c71f7b8e6dfd00e7239d418ff19794faa2bad1) @@ -29,15 +29,15 @@ namespace Ringtoets.Common.Forms.TreeNodeInfos { /// - /// Decorator for . + /// Decorator for . /// public class RingtoetsContextMenuBuilder { private readonly IContextMenuBuilder contextMenuBuilder; private readonly RingtoetsContextMenuItemFactory ringtoetsContextMenuItemFactory; /// - /// Creates a new instance of the . + /// Creates a new instance of the class. /// /// The context menu builder to decorate. public RingtoetsContextMenuBuilder(IContextMenuBuilder contextMenuBuilder) @@ -47,122 +47,214 @@ ringtoetsContextMenuItemFactory = new RingtoetsContextMenuItemFactory(); } + /// + /// Adds an item to the , which adds a new calculation group to a calculation group. + /// + /// The calculation group to add the new calculation groups to. + /// The itself. public RingtoetsContextMenuBuilder AddCreateCalculationGroupItem(CalculationGroup calculationGroup) { contextMenuBuilder.AddCustomItem(ringtoetsContextMenuItemFactory.CreateAddCalculationGroupItem(calculationGroup)); return this; } + /// + /// Adds an item to the , which adds a new calculation to a calculation group. + /// + /// The type of the calculation group context. + /// The calculation group context belonging to the calculation group. + /// The action for adding a calculation to the calculation group. + /// The itself. public RingtoetsContextMenuBuilder AddCreateCalculationItem( TCalculationContext calculationGroupContext, - Action addCalculation) + Action addCalculationAction) where TCalculationContext : ICalculationContext { - contextMenuBuilder.AddCustomItem(ringtoetsContextMenuItemFactory.CreateAddCalculationItem(calculationGroupContext, addCalculation)); + contextMenuBuilder.AddCustomItem(ringtoetsContextMenuItemFactory.CreateAddCalculationItem(calculationGroupContext, addCalculationAction)); return this; } + /// + /// Adds an item to the , which clears the output of all calculations in a calculation group. + /// + /// The calculation group to clear the output for. + /// The itself. public RingtoetsContextMenuBuilder AddClearAllCalculationOutputInGroupItem(CalculationGroup calculationGroup) { contextMenuBuilder.AddCustomItem(ringtoetsContextMenuItemFactory.CreateClearAllCalculationOutputInGroupItem(calculationGroup)); return this; } + /// + /// Adds an item to the , which performs all calculations in a calculation group. + /// + /// The type of the calculation group context. + /// The calculation group to perform all calculations for. + /// The calculation group context belonging to the calculation group. + /// The action that performs all calculations. + /// The itself. public RingtoetsContextMenuBuilder AddPerformAllCalculationsInGroupItem( CalculationGroup calculationGroup, - TCalculationContext context, - Action calculateAll) + TCalculationContext calculationGroupContext, + Action calculateAllAction) where TCalculationContext : ICalculationContext { - contextMenuBuilder.AddCustomItem(ringtoetsContextMenuItemFactory.CreatePerformAllCalculationsInGroupItem(calculationGroup, context, calculateAll)); + contextMenuBuilder.AddCustomItem(ringtoetsContextMenuItemFactory.CreatePerformAllCalculationsInGroupItem(calculationGroup, calculationGroupContext, calculateAllAction)); return this; } + /// + /// Adds an item to the , which performs a calculation. + /// + /// The type of the calculation. + /// The type of the calculation context. + /// The calculation to perform. + /// The calculation context belonging to the calculation. + /// The action that performs the calculation. + /// The itself. public RingtoetsContextMenuBuilder AddPerformCalculationItem( TCalculation calculation, - TCalculationContext context, - Action calculate) + TCalculationContext calculationContext, + Action calculateAction) where TCalculationContext : ICalculationContext where TCalculation : ICalculation { - contextMenuBuilder.AddCustomItem(ringtoetsContextMenuItemFactory.CreatePerformCalculationItem(calculation, context, calculate)); + contextMenuBuilder.AddCustomItem(ringtoetsContextMenuItemFactory.CreatePerformCalculationItem(calculation, calculationContext, calculateAction)); return this; } + /// + /// Adds an item to the , which clears the output of a calculation. + /// + /// The calculation to clear the output for. + /// The itself. public RingtoetsContextMenuBuilder AddClearCalculationOutputItem(ICalculation calculation) { contextMenuBuilder.AddCustomItem(ringtoetsContextMenuItemFactory.CreateClearCalculationOutputItem(calculation)); return this; } + /// + /// Adds an item to the , which enables a disabled failure mechanism. + /// + /// The failure mechanism context belonging to the failure mechanism. + /// The itself. public RingtoetsContextMenuBuilder AddDisabledChangeRelevancyItem(IFailureMechanismContext failureMechanismContext) { contextMenuBuilder.AddCustomItem(ringtoetsContextMenuItemFactory.CreateDisabledChangeRelevancyItem(failureMechanismContext)); return this; } - # region Decorated interface members + # region Decorated members + /// + /// Adds an item to the , which starts edit mode for the name of . + /// + /// The itself. public RingtoetsContextMenuBuilder AddRenameItem() { contextMenuBuilder.AddRenameItem(); return this; } + /// + /// Adds an item to the , which deletes the . + /// + /// The itself. public RingtoetsContextMenuBuilder AddDeleteItem() { contextMenuBuilder.AddDeleteItem(); return this; } + /// + /// Adds an item to the , which expands the . + /// + /// The itself. public RingtoetsContextMenuBuilder AddExpandAllItem() { contextMenuBuilder.AddExpandAllItem(); return this; } + /// + /// Adds an item to the , which collapses the . + /// + /// The itself. public RingtoetsContextMenuBuilder AddCollapseAllItem() { contextMenuBuilder.AddCollapseAllItem(); return this; } + /// + /// Adds an item to the , which opens a view for the data of the . + /// + /// The itself. public RingtoetsContextMenuBuilder AddOpenItem() { contextMenuBuilder.AddOpenItem(); return this; } + /// + /// Adds an item to the , which exports the data of the . + /// + /// The itself. public RingtoetsContextMenuBuilder AddExportItem() { contextMenuBuilder.AddExportItem(); return this; } + /// + /// Adds an item to the , which imports to the data of the . + /// + /// The itself. public RingtoetsContextMenuBuilder AddImportItem() { contextMenuBuilder.AddImportItem(); return this; } + /// + /// Adds an item to the , which shows properties of the data of the . + /// + /// The itself. public RingtoetsContextMenuBuilder AddPropertiesItem() { contextMenuBuilder.AddPropertiesItem(); return this; } + /// + /// Adds a to the . A + /// is only added if the last item that was added to the exists and is not a + /// . + /// + /// The itself. public RingtoetsContextMenuBuilder AddSeparator() { contextMenuBuilder.AddSeparator(); return this; } + /// + /// Adds a custom item to the . + /// + /// The custom to add to the . + /// The itself. public RingtoetsContextMenuBuilder AddCustomItem(StrictContextMenuItem item) { contextMenuBuilder.AddCustomItem(item); return this; } + /// + /// Obtain the , which has been constructed by using the other methods of + /// . + /// + /// The constructed . public ContextMenuStrip Build() { return contextMenuBuilder.Build(); Index: Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/RingtoetsContextMenuItemFactory.cs =================================================================== diff -u -re2991a38a1982398a6cbb35e38e534e26ba8930d -r44c71f7b8e6dfd00e7239d418ff19794faa2bad1 --- Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/RingtoetsContextMenuItemFactory.cs (.../RingtoetsContextMenuItemFactory.cs) (revision e2991a38a1982398a6cbb35e38e534e26ba8930d) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/RingtoetsContextMenuItemFactory.cs (.../RingtoetsContextMenuItemFactory.cs) (revision 44c71f7b8e6dfd00e7239d418ff19794faa2bad1) @@ -41,7 +41,7 @@ /// /// Creates a which is bound to the action of adding new calculation groups. /// - /// The calculation group involved. + /// The calculation group to add the new calculation groups to. /// The created . public StrictContextMenuItem CreateAddCalculationGroupItem(CalculationGroup calculationGroup) { @@ -55,25 +55,26 @@ /// /// Creates a which is bound to the action of adding new calculations. /// - /// The calculation group context involved. - /// The action for adding a calculation to the calculation group. + /// The type of the calculation group context. + /// The calculation group context belonging to the calculation group. + /// The action for adding a calculation to the calculation group. /// The created . public StrictContextMenuItem CreateAddCalculationItem( TCalculationContext calculationGroupContext, - Action addCalculation) + Action addCalculationAction) where TCalculationContext : ICalculationContext { return new StrictContextMenuItem( Resources.CalculationGroup_Add_Calculation, Resources.CalculationGroup_Add_Calculation_Tooltip, Resources.FailureMechanismIcon, - (o, args) => addCalculation(calculationGroupContext)); + (o, args) => addCalculationAction(calculationGroupContext)); } /// /// Creates a which is bound to the action of clearing the output of all calculations in the calculation group. /// - /// The calculation group involved. + /// The calculation group to clear the output for. /// The created . public StrictContextMenuItem CreateClearAllCalculationOutputInGroupItem(CalculationGroup calculationGroup) { @@ -95,21 +96,22 @@ /// /// Creates a which is bound to the action of performing all calculations in a calculation group. /// - /// The calculation group involved. - /// The calculation group context belonging to the calculation group. - /// The action that performs all calculations. + /// The type of the calculation group context. + /// The calculation group to perform all calculations for. + /// The calculation group context belonging to the calculation group. + /// The action that performs all calculations. /// The created . public StrictContextMenuItem CreatePerformAllCalculationsInGroupItem( CalculationGroup calculationGroup, - TCalculationContext context, - Action calculateAll) + TCalculationContext calculationGroupContext, + Action calculateAllAction) where TCalculationContext : ICalculationContext { var performAllItem = new StrictContextMenuItem( Resources.Calculate_all, Resources.CalculationGroup_CalculateAll_ToolTip, Resources.CalculateAllIcon, - (o, args) => calculateAll(calculationGroup, context)); + (o, args) => calculateAllAction(calculationGroup, calculationGroupContext)); if (!calculationGroup.GetCalculations().Any()) { @@ -123,28 +125,30 @@ /// /// Creates a which is bound to the action of performing a calculation. /// - /// The calculation involved. - /// The calculation context belonging to the calculation. - /// The action that performs the calculation. + /// The type of the calculation. + /// The type of the calculation context. + /// The calculation to perform. + /// The calculation context belonging to the calculation. + /// The action that performs the calculation. /// The created . public StrictContextMenuItem CreatePerformCalculationItem( TCalculation calculation, - TCalculationContext context, - Action calculate) + TCalculationContext calculationContext, + Action calculateAction) where TCalculationContext : ICalculationContext where TCalculation : ICalculation { return new StrictContextMenuItem( Resources.Calculate, Resources.Calculate_ToolTip, Resources.CalculateIcon, - (o, args) => calculate(calculation, context)); + (o, args) => calculateAction(calculation, calculationContext)); } /// /// Creates a which is bound to the action of clearing the output of a calculation. /// - /// The calculation involved. + /// The calculation to clear the output for. /// The created . public StrictContextMenuItem CreateClearCalculationOutputItem(ICalculation calculation) { @@ -166,7 +170,7 @@ /// /// Creates a which is bound to the action of changing the relevancy state of a disabled failure mechanism. /// - /// The failure mechanism context involved. + /// The failure mechanism context belonging to the failure mechanism. /// The created . public StrictContextMenuItem CreateDisabledChangeRelevancyItem(IFailureMechanismContext failureMechanismContext) {