Index: Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/CalculationTreeNodeInfoFactory.cs =================================================================== diff -u -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a -r2c8727ab981f791b6324428b063c414c45a607a3 --- Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/CalculationTreeNodeInfoFactory.cs (.../CalculationTreeNodeInfoFactory.cs) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/CalculationTreeNodeInfoFactory.cs (.../CalculationTreeNodeInfoFactory.cs) (revision 2c8727ab981f791b6324428b063c414c45a607a3) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using System.Drawing; using System.Linq; using System.Windows.Forms; using Core.Common.Controls.TreeView; @@ -76,6 +77,23 @@ } /// + /// Creates a object for a calculation context of the type . + /// + /// The icon of the . + /// The type of calculation context to create a object for. + /// A object. + public static TreeNodeInfo CreateCalculationContextTreeNodeInfo(Bitmap icon) + where TCalculationContext : ICalculationContext + { + return new TreeNodeInfo + { + Text = context => context.WrappedData.Name, + Image = context => icon, + EnsureVisibleOnCreate = (context, parent) => true + }; + } + + /// /// This method adds a context menu item for creating new calculation groups. /// /// The builder to add the context menu item to.