Index: Core/Common/src/Core.Common.Controls.TreeView/TreeNodeInfo.cs =================================================================== diff -u -r6b6481cda445a35c68548bc85233456072054782 -r7e6c0b97836346830f6d1d4ffea8df72695710cc --- Core/Common/src/Core.Common.Controls.TreeView/TreeNodeInfo.cs (.../TreeNodeInfo.cs) (revision 6b6481cda445a35c68548bc85233456072054782) +++ Core/Common/src/Core.Common.Controls.TreeView/TreeNodeInfo.cs (.../TreeNodeInfo.cs) (revision 7e6c0b97836346830f6d1d4ffea8df72695710cc) @@ -102,10 +102,10 @@ public Func CanRemove { get; set; } /// - /// Gets or sets a function for obtaining the text that is shown before the tree node is removed. + /// Gets or sets a function for obtaining the confirmation text that is shown before the tree node is removed. /// The object parameter represents the data of the tree node. /// - public Func BeforeNodeRemoveText { get; set; } + public Func OnRemoveConfirmationText { get; set; } /// /// Gets or sets an action for obtaining the logic to perform after removing the tree node. @@ -259,10 +259,10 @@ public Action OnNodeRemoved { get; set; } /// - /// Gets or sets a function for obtaining the text that is shown before the tree node is removed. + /// Gets or sets a function for obtaining the confirmation text that is shown before the tree node is removed. /// The parameter represents the data of the tree node. /// - public Func BeforeNodeRemoveText { get; set; } + public Func OnRemoveConfirmationText { get; set; } /// /// Gets or sets a function for checking whether or not the tree node can be checked. @@ -357,8 +357,8 @@ CanRemove = treeNodeInfo.CanRemove != null ? (tag, parentTag) => treeNodeInfo.CanRemove((TData) tag, parentTag) : (Func) null, - BeforeNodeRemoveText = treeNodeInfo.BeforeNodeRemoveText != null - ? tag => treeNodeInfo.BeforeNodeRemoveText((TData) tag) + OnRemoveConfirmationText = treeNodeInfo.OnRemoveConfirmationText != null + ? tag => treeNodeInfo.OnRemoveConfirmationText((TData) tag) : (Func) null, OnNodeRemoved = treeNodeInfo.OnNodeRemoved != null ? (tag, parentTag) => treeNodeInfo.OnNodeRemoved((TData) tag, parentTag) Index: Core/Common/src/Core.Common.Controls.TreeView/TreeViewControl.cs =================================================================== diff -u -r870f4fe29ebcc33e2ca7eda3c51fb404051b855f -r7e6c0b97836346830f6d1d4ffea8df72695710cc --- Core/Common/src/Core.Common.Controls.TreeView/TreeViewControl.cs (.../TreeViewControl.cs) (revision 870f4fe29ebcc33e2ca7eda3c51fb404051b855f) +++ Core/Common/src/Core.Common.Controls.TreeView/TreeViewControl.cs (.../TreeViewControl.cs) (revision 7e6c0b97836346830f6d1d4ffea8df72695710cc) @@ -407,8 +407,8 @@ TreeNodeInfo treeNodeInfo = TryGetTreeNodeInfoForData(treeNode.Tag); - string message = treeNodeInfo.BeforeNodeRemoveText != null - ? treeNodeInfo.BeforeNodeRemoveText(treeNode.Tag) + string message = treeNodeInfo.OnRemoveConfirmationText != null + ? treeNodeInfo.OnRemoveConfirmationText(treeNode.Tag) : Resources.TreeViewControl_Are_you_sure_you_want_to_remove_the_selected_item; if (MessageBox.Show(message, BaseResources.Confirm, MessageBoxButtons.OKCancel) != DialogResult.OK) Index: Core/Common/test/Core.Common.Controls.TreeView.Test/TreeNodeInfoTest.cs =================================================================== diff -u -r6b6481cda445a35c68548bc85233456072054782 -r7e6c0b97836346830f6d1d4ffea8df72695710cc --- Core/Common/test/Core.Common.Controls.TreeView.Test/TreeNodeInfoTest.cs (.../TreeNodeInfoTest.cs) (revision 6b6481cda445a35c68548bc85233456072054782) +++ Core/Common/test/Core.Common.Controls.TreeView.Test/TreeNodeInfoTest.cs (.../TreeNodeInfoTest.cs) (revision 7e6c0b97836346830f6d1d4ffea8df72695710cc) @@ -47,7 +47,7 @@ Assert.IsNull(treeNodeInfo.CanRename); Assert.IsNull(treeNodeInfo.OnNodeRenamed); Assert.IsNull(treeNodeInfo.CanRemove); - Assert.IsNull(treeNodeInfo.BeforeNodeRemoveText); + Assert.IsNull(treeNodeInfo.OnRemoveConfirmationText); Assert.IsNull(treeNodeInfo.OnNodeRemoved); Assert.IsNull(treeNodeInfo.CanCheck); Assert.IsNull(treeNodeInfo.CheckedState); @@ -73,7 +73,7 @@ Func childNodeObjects = o => new object[0]; Func canRename = (o1, o2) => true; Action onNodeRenamed = (o, newName) => {}; - Func beforeNodeRemoveText = o => ""; + Func onRemoveConfirmationText = o => ""; Func canRemove = (o1, o2) => true; Action onNodeRemoved = (o1, o2) => {}; Func canCheck = o => true; @@ -96,7 +96,7 @@ treeNodeInfo.CanRename = canRename; treeNodeInfo.OnNodeRenamed = onNodeRenamed; treeNodeInfo.CanRemove = canRemove; - treeNodeInfo.BeforeNodeRemoveText = beforeNodeRemoveText; + treeNodeInfo.OnRemoveConfirmationText = onRemoveConfirmationText; treeNodeInfo.OnNodeRemoved = onNodeRemoved; treeNodeInfo.CanCheck = canCheck; treeNodeInfo.CheckedState = isChecked; @@ -118,7 +118,7 @@ Assert.AreEqual(canRename, treeNodeInfo.CanRename); Assert.AreEqual(onNodeRenamed, treeNodeInfo.OnNodeRenamed); Assert.AreEqual(canRemove, treeNodeInfo.CanRemove); - Assert.AreEqual(beforeNodeRemoveText, treeNodeInfo.BeforeNodeRemoveText); + Assert.AreEqual(onRemoveConfirmationText, treeNodeInfo.OnRemoveConfirmationText); Assert.AreEqual(onNodeRemoved, treeNodeInfo.OnNodeRemoved); Assert.AreEqual(canCheck, treeNodeInfo.CanCheck); Assert.AreEqual(isChecked, treeNodeInfo.CheckedState); @@ -147,7 +147,7 @@ Assert.IsNull(treeNodeInfo.CanRename); Assert.IsNull(treeNodeInfo.OnNodeRenamed); Assert.IsNull(treeNodeInfo.CanRemove); - Assert.IsNull(treeNodeInfo.BeforeNodeRemoveText); + Assert.IsNull(treeNodeInfo.OnRemoveConfirmationText); Assert.IsNull(treeNodeInfo.OnNodeRemoved); Assert.IsNull(treeNodeInfo.CanCheck); Assert.IsNull(treeNodeInfo.CheckedState); @@ -173,7 +173,7 @@ Func canRename = (o1, o2) => true; Action onNodeRenamed = (o, newName) => {}; Func canRemove = (o1, o2) => true; - Func beforeNodeRemoveText = o => ""; + Func onRemoveConfirmationText = o => ""; Action onNodeRemoved = (o1, o2) => {}; Func canCheck = o => true; Func isChecked = o => TreeNodeCheckedState.Checked; @@ -194,7 +194,7 @@ treeNodeInfo.CanRename = canRename; treeNodeInfo.OnNodeRenamed = onNodeRenamed; treeNodeInfo.CanRemove = canRemove; - treeNodeInfo.BeforeNodeRemoveText = beforeNodeRemoveText; + treeNodeInfo.OnRemoveConfirmationText = onRemoveConfirmationText; treeNodeInfo.OnNodeRemoved = onNodeRemoved; treeNodeInfo.CanCheck = canCheck; treeNodeInfo.CheckedState = isChecked; @@ -216,7 +216,7 @@ Assert.AreEqual(canRename, treeNodeInfo.CanRename); Assert.AreEqual(onNodeRenamed, treeNodeInfo.OnNodeRenamed); Assert.AreEqual(canRemove, treeNodeInfo.CanRemove); - Assert.AreEqual(beforeNodeRemoveText, treeNodeInfo.BeforeNodeRemoveText); + Assert.AreEqual(onRemoveConfirmationText, treeNodeInfo.OnRemoveConfirmationText); Assert.AreEqual(onNodeRemoved, treeNodeInfo.OnNodeRemoved); Assert.AreEqual(canCheck, treeNodeInfo.CanCheck); Assert.AreEqual(isChecked, treeNodeInfo.CheckedState); @@ -250,7 +250,7 @@ Assert.IsNull(treeNodeInfo.CanRename); Assert.IsNull(treeNodeInfo.OnNodeRenamed); Assert.IsNull(treeNodeInfo.CanRemove); - Assert.IsNull(treeNodeInfo.BeforeNodeRemoveText); + Assert.IsNull(treeNodeInfo.OnRemoveConfirmationText); Assert.IsNull(treeNodeInfo.OnNodeRemoved); Assert.IsNull(treeNodeInfo.CanCheck); Assert.IsNull(treeNodeInfo.CheckedState); @@ -291,7 +291,7 @@ CanRename = (o1, o2) => true, OnNodeRenamed = (o, newName) => { onNodeRenamedCounter++; }, CanRemove = (o1, o2) => true, - BeforeNodeRemoveText = o => "Confirmation message", + OnRemoveConfirmationText = o => "Confirmation message", OnNodeRemoved = (o1, o2) => { onNodeRemovedCounter++; }, CanCheck = o => true, CheckedState = o => TreeNodeCheckedState.Checked, @@ -326,7 +326,7 @@ Assert.AreEqual(1, treeNodeInfo.ChildNodeObjects(0).Length); Assert.IsTrue(treeNodeInfo.CanRename(0, 1)); Assert.IsTrue(treeNodeInfo.CanRemove(0, 1)); - Assert.AreEqual("Confirmation message", treeNodeInfo.BeforeNodeRemoveText(0)); + Assert.AreEqual("Confirmation message", treeNodeInfo.OnRemoveConfirmationText(0)); Assert.IsTrue(treeNodeInfo.CanCheck(0)); Assert.AreEqual(TreeNodeCheckedState.Checked, treeNodeInfo.CheckedState(0)); Assert.IsTrue(treeNodeInfo.CanDrag(0, 1)); Index: Core/Common/test/Core.Common.Controls.TreeView.Test/TreeViewControlTest.cs =================================================================== diff -u -r870f4fe29ebcc33e2ca7eda3c51fb404051b855f -r7e6c0b97836346830f6d1d4ffea8df72695710cc --- Core/Common/test/Core.Common.Controls.TreeView.Test/TreeViewControlTest.cs (.../TreeViewControlTest.cs) (revision 870f4fe29ebcc33e2ca7eda3c51fb404051b855f) +++ Core/Common/test/Core.Common.Controls.TreeView.Test/TreeViewControlTest.cs (.../TreeViewControlTest.cs) (revision 7e6c0b97836346830f6d1d4ffea8df72695710cc) @@ -517,7 +517,7 @@ { TagType = typeof(object), CanRemove = (o, p) => true, - BeforeNodeRemoveText = o => confirmationMessage + OnRemoveConfirmationText = o => confirmationMessage }; treeViewControl.RegisterTreeNodeInfo(treeNodeInfo); var dataObject = new object(); Index: Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs =================================================================== diff -u -r7f9e873cc6686f11129e65e56371f8f7930d8264 -r7e6c0b97836346830f6d1d4ffea8df72695710cc --- Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision 7f9e873cc6686f11129e65e56371f8f7930d8264) +++ Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision 7e6c0b97836346830f6d1d4ffea8df72695710cc) @@ -1039,7 +1039,7 @@ Text = context => noProbabilityValueDoubleConverter.ConvertToString(context.WrappedData.TargetProbability), Image = context => RiskeerCommonFormsResources.GenericInputOutputIcon, EnsureVisibleOnCreate = (context, o) => true, - BeforeNodeRemoveText = context => Resources.RiskeerPlugin_GetTreeNodeInfos_HydraulicBoundaryDatabaseUpdateHandler_Confirm_remove_TargetProbability, + OnRemoveConfirmationText = context => Resources.RiskeerPlugin_GetTreeNodeInfos_HydraulicBoundaryDatabaseUpdateHandler_Confirm_remove_TargetProbability, CanRemove = (context, o) => true, OnNodeRemoved = WaterLevelHydraulicBoundaryCalculationsForUserDefinedTargetProbabilityOnNodeRemoved, ContextMenuStrip = WaterLevelCalculationsForUserDefinedTargetProbabilityContextMenuStrip, @@ -1062,7 +1062,7 @@ Text = context => noProbabilityValueDoubleConverter.ConvertToString(context.WrappedData.TargetProbability), Image = context => RiskeerCommonFormsResources.GenericInputOutputIcon, EnsureVisibleOnCreate = (context, o) => true, - BeforeNodeRemoveText = context => Resources.RiskeerPlugin_GetTreeNodeInfos_HydraulicBoundaryDatabaseUpdateHandler_Confirm_remove_TargetProbability, + OnRemoveConfirmationText = context => Resources.RiskeerPlugin_GetTreeNodeInfos_HydraulicBoundaryDatabaseUpdateHandler_Confirm_remove_TargetProbability, CanRemove = (context, o) => true, OnNodeRemoved = HydraulicBoundaryCalculationsForUserDefinedTargetProbabilityOnNodeRemoved, ContextMenuStrip = WaveHeightCalculationsForUserDefinedTargetProbabilityContextMenuStrip, Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterLevelCalculationsForUserDefinedTargetProbabilityContextTreeNodeInfoTest.cs =================================================================== diff -u -r7f9e873cc6686f11129e65e56371f8f7930d8264 -r7e6c0b97836346830f6d1d4ffea8df72695710cc --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterLevelCalculationsForUserDefinedTargetProbabilityContextTreeNodeInfoTest.cs (.../WaterLevelCalculationsForUserDefinedTargetProbabilityContextTreeNodeInfoTest.cs) (revision 7f9e873cc6686f11129e65e56371f8f7930d8264) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterLevelCalculationsForUserDefinedTargetProbabilityContextTreeNodeInfoTest.cs (.../WaterLevelCalculationsForUserDefinedTargetProbabilityContextTreeNodeInfoTest.cs) (revision 7e6c0b97836346830f6d1d4ffea8df72695710cc) @@ -92,7 +92,7 @@ Assert.IsNull(info.CanRename); Assert.IsNull(info.OnNodeRenamed); Assert.IsNotNull(info.CanRemove); - Assert.IsNotNull(info.BeforeNodeRemoveText); + Assert.IsNotNull(info.OnRemoveConfirmationText); Assert.IsNotNull(info.OnNodeRemoved); Assert.IsNull(info.CanCheck); Assert.IsNull(info.CheckedState); @@ -177,22 +177,22 @@ } [Test] - public void BeforeRemoveNodeText_Always_ReturnsConfirmationMessage() + public void OnRemoveConfirmationText_Always_ReturnsConfirmationMessage() { // Setup using (var plugin = new RiskeerPlugin()) { TreeNodeInfo info = GetInfo(plugin); // Call - string beforeNodeRemoveText = info.BeforeNodeRemoveText(null); + string onRemoveConfirmationText = info.OnRemoveConfirmationText(null); // Assert string expectedText = "Als u deze doelkans verwijdert, dan wordt de uitvoer van alle ervan afhankelijke berekeningen verwijderd." + Environment.NewLine + Environment.NewLine + "Weet u zeker dat u wilt doorgaan?"; - Assert.AreEqual(expectedText, beforeNodeRemoveText); + Assert.AreEqual(expectedText, onRemoveConfirmationText); } } Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaveHeightCalculationsForUserDefinedTargetProbabilityContextTreeNodeInfoTest.cs =================================================================== diff -u -r7f9e873cc6686f11129e65e56371f8f7930d8264 -r7e6c0b97836346830f6d1d4ffea8df72695710cc --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaveHeightCalculationsForUserDefinedTargetProbabilityContextTreeNodeInfoTest.cs (.../WaveHeightCalculationsForUserDefinedTargetProbabilityContextTreeNodeInfoTest.cs) (revision 7f9e873cc6686f11129e65e56371f8f7930d8264) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaveHeightCalculationsForUserDefinedTargetProbabilityContextTreeNodeInfoTest.cs (.../WaveHeightCalculationsForUserDefinedTargetProbabilityContextTreeNodeInfoTest.cs) (revision 7e6c0b97836346830f6d1d4ffea8df72695710cc) @@ -84,7 +84,7 @@ Assert.IsNull(info.CanRename); Assert.IsNull(info.OnNodeRenamed); Assert.IsNotNull(info.CanRemove); - Assert.IsNotNull(info.BeforeNodeRemoveText); + Assert.IsNotNull(info.OnRemoveConfirmationText); Assert.IsNotNull(info.OnNodeRemoved); Assert.IsNull(info.CanCheck); Assert.IsNull(info.CheckedState); @@ -169,22 +169,22 @@ } [Test] - public void BeforeRemoveNodeText_Always_ReturnsConfirmationMessage() + public void OnRemoveConfirmationText_Always_ReturnsConfirmationMessage() { // Setup using (var plugin = new RiskeerPlugin()) { TreeNodeInfo info = GetInfo(plugin); // Call - string beforeNodeRemoveText = info.BeforeNodeRemoveText(null); + string onRemoveConfirmationText = info.OnRemoveConfirmationText(null); // Assert string expectedText = "Als u deze doelkans verwijdert, dan wordt de uitvoer van alle ervan afhankelijke berekeningen verwijderd." + Environment.NewLine + Environment.NewLine + "Weet u zeker dat u wilt doorgaan?"; - Assert.AreEqual(expectedText, beforeNodeRemoveText); + Assert.AreEqual(expectedText, onRemoveConfirmationText); } }