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();