Index: Core/Common/src/Core.Common.Controls.TreeView/DragDropHandler.cs =================================================================== diff -u -r2ec08867a90646f09852fb338e18b70c6176b5ac -rb060eed93e2290dbe0a36da6e5556002625b73d5 --- Core/Common/src/Core.Common.Controls.TreeView/DragDropHandler.cs (.../DragDropHandler.cs) (revision 2ec08867a90646f09852fb338e18b70c6176b5ac) +++ Core/Common/src/Core.Common.Controls.TreeView/DragDropHandler.cs (.../DragDropHandler.cs) (revision b060eed93e2290dbe0a36da6e5556002625b73d5) @@ -116,7 +116,7 @@ var treeNodeInfo = getTreeNodeInfoForData(nodeDropTarget.Tag); DragOperations allowedOperations = treeNodeInfo.CanDrop != null - ? treeNodeInfo.CanDrop(nodeDragging.Tag, nodeDropTarget.Tag, ToDragOperation(e.AllowedEffect)) + ? treeNodeInfo.CanDrop(nodeDragging.Tag, nodeDropTarget.Tag) : DragOperations.None; e.Effect = ToDragDropEffects(allowedOperations); @@ -129,7 +129,7 @@ // Determine whether or not the node can be dropped based on the allowed operations. // A node can also be a valid drop target if it is the root item (nodeDragging.Parent == null). var dragOperations = treeNodeInfo.CanDrop != null - ? treeNodeInfo.CanDrop(nodeDragging.Tag, nodeDropTarget.Tag, allowedOperations) + ? treeNodeInfo.CanDrop(nodeDragging.Tag, nodeDropTarget.Tag) : DragOperations.None; if (DragOperations.None != dragOperations) @@ -204,11 +204,6 @@ } } - private DragOperations ToDragOperation(DragDropEffects dragDropEffects) - { - return (DragOperations) Enum.Parse(typeof(DragOperations), dragDropEffects.ToString()); - } - private bool IsChildOf(TreeNode childNode, TreeNode node) { while (childNode != null && childNode.Parent != null) Index: Core/Common/src/Core.Common.Controls.TreeView/TreeNodeInfo.cs =================================================================== diff -u -r2ec08867a90646f09852fb338e18b70c6176b5ac -rb060eed93e2290dbe0a36da6e5556002625b73d5 --- Core/Common/src/Core.Common.Controls.TreeView/TreeNodeInfo.cs (.../TreeNodeInfo.cs) (revision 2ec08867a90646f09852fb338e18b70c6176b5ac) +++ Core/Common/src/Core.Common.Controls.TreeView/TreeNodeInfo.cs (.../TreeNodeInfo.cs) (revision b060eed93e2290dbe0a36da6e5556002625b73d5) @@ -139,11 +139,10 @@ /// Gets or sets a function for checking whether or not the tree node can be dropped to another location. /// The first object parameter represents the data of the tree node which is dragged. /// The second object parameter represents the data of the tree node being considered as drop target. - /// The parameter represents the supported drop operations for the tree node which is dragged. /// The return value indicates what operation is valid when the tree node is dropped onto the drop target. /// /// When dragging a node, the function of the of the drop target should be called. - public Func CanDrop { get; set; } + public Func CanDrop { get; set; } /// /// Gets or sets a function for checking whether or not the tree node can be inserted into the drop target at a specific index. @@ -285,11 +284,10 @@ /// Gets or sets a function for checking whether or not the tree node can be dropped to another location. /// The first object parameter represents the data of the tree node which is dragged. /// The second object parameter represents the data of the tree node being considered as drop target. - /// The parameter represents the supported drop operations for the tree node which is dragged. /// The return value indicates what operation is valid when the tree node is dropped onto the drop target. /// /// When dragging a node, the function of the of the drop target should be called. - public Func CanDrop { get; set; } + public Func CanDrop { get; set; } /// /// Gets or sets a function for checking whether or not the tree node can be inserted into the drop target at a specific index. @@ -362,8 +360,8 @@ ? (tag, parentTag) => treeNodeInfo.CanDrag((TData) tag, parentTag) : (Func) null, CanDrop = treeNodeInfo.CanDrop != null - ? (draggedTag, targetTag, dragOperations) => treeNodeInfo.CanDrop(draggedTag, targetTag, dragOperations) - : (Func) null, + ? (draggedTag, targetTag) => treeNodeInfo.CanDrop(draggedTag, targetTag) + : (Func) null, CanInsert = treeNodeInfo.CanInsert != null ? (draggedTag, targetTag) => treeNodeInfo.CanInsert(draggedTag, targetTag) : (Func) null, Index: Core/Plugins/src/Core.Plugins.OxyPlot/Legend/LegendView.cs =================================================================== diff -u -r2ec08867a90646f09852fb338e18b70c6176b5ac -rb060eed93e2290dbe0a36da6e5556002625b73d5 --- Core/Plugins/src/Core.Plugins.OxyPlot/Legend/LegendView.cs (.../LegendView.cs) (revision 2ec08867a90646f09852fb338e18b70c6176b5ac) +++ Core/Plugins/src/Core.Plugins.OxyPlot/Legend/LegendView.cs (.../LegendView.cs) (revision b060eed93e2290dbe0a36da6e5556002625b73d5) @@ -149,11 +149,11 @@ # region ChartDataCollection - private DragOperations BaseChartCanDrop(object draggedData, object targetData, DragOperations validOperations) + private DragOperations BaseChartCanDrop(object draggedData, object targetData) { if (draggedData is ChartData) { - return validOperations; + return DragOperations.Move; } return DragOperations.None; Index: Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/ChartDataCollectionTreeNodeInfoTest.cs =================================================================== diff -u -r2ec08867a90646f09852fb338e18b70c6176b5ac -rb060eed93e2290dbe0a36da6e5556002625b73d5 --- Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/ChartDataCollectionTreeNodeInfoTest.cs (.../ChartDataCollectionTreeNodeInfoTest.cs) (revision 2ec08867a90646f09852fb338e18b70c6176b5ac) +++ Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/ChartDataCollectionTreeNodeInfoTest.cs (.../ChartDataCollectionTreeNodeInfoTest.cs) (revision b060eed93e2290dbe0a36da6e5556002625b73d5) @@ -111,17 +111,15 @@ } [Test] - [TestCase(DragOperations.Move)] - [TestCase(DragOperations.None)] - public void CanDrop_SourceNodeTagIsNoChartData_ReturnsDragOperationsNone(DragOperations validDragOperations) + public void CanDrop_SourceNodeTagIsNoChartData_ReturnsDragOperationsNone() { // Setup var chartDataCollection = mocks.StrictMock(new List()); mocks.ReplayAll(); // Call - var validOperations = info.CanDrop(new object(), chartDataCollection, validDragOperations); + var validOperations = info.CanDrop(new object(), chartDataCollection); // Assert Assert.AreEqual(DragOperations.None, validOperations); @@ -130,9 +128,7 @@ } [Test] - [TestCase(DragOperations.Move)] - [TestCase(DragOperations.None)] - public void CanDrop_SourceNodeTagIsChartData_ReturnsGivenDragOperations(DragOperations validDragOperations) + public void CanDrop_SourceNodeTagIsChartData_ReturnsDragOperationsMove() { // Setup var chartData = mocks.StrictMock(); @@ -141,10 +137,10 @@ mocks.ReplayAll(); // Call - var validOperations = info.CanDrop(chartData, chartDataCollection, validDragOperations); + var validOperations = info.CanDrop(chartData, chartDataCollection); // Assert - Assert.AreEqual(validDragOperations, validOperations); + Assert.AreEqual(DragOperations.Move, validOperations); mocks.VerifyAll(); } Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs =================================================================== diff -u -r2ec08867a90646f09852fb338e18b70c6176b5ac -rb060eed93e2290dbe0a36da6e5556002625b73d5 --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs (.../PipingGuiPlugin.cs) (revision 2ec08867a90646f09852fb338e18b70c6176b5ac) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs (.../PipingGuiPlugin.cs) (revision b060eed93e2290dbe0a36da6e5556002625b73d5) @@ -702,11 +702,11 @@ return true; } - private DragOperations PipingCalculationGroupContextCanDrop(object draggedData, object targetData, DragOperations validOperations) + private DragOperations PipingCalculationGroupContextCanDrop(object draggedData, object targetData) { if (GetAsIPipingCalculationItem(draggedData) != null && NodesHaveSameParentFailureMechanism(draggedData, targetData)) { - return validOperations; + return DragOperations.Move; } return DragOperations.None; Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -ra1de055e3698f610875e623d39f4526970568cef -rb060eed93e2290dbe0a36da6e5556002625b73d5 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationGroupContextTreeNodeInfoTest.cs (.../PipingCalculationGroupContextTreeNodeInfoTest.cs) (revision a1de055e3698f610875e623d39f4526970568cef) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationGroupContextTreeNodeInfoTest.cs (.../PipingCalculationGroupContextTreeNodeInfoTest.cs) (revision b060eed93e2290dbe0a36da6e5556002625b73d5) @@ -139,7 +139,7 @@ { case DragDropTestMethod.CanDrop: // Call - DragOperations supportedOperations = info.CanDrop(draggedItemContext, targetGroupContext, DragOperations.Move); + DragOperations supportedOperations = info.CanDrop(draggedItemContext, targetGroupContext); // Assert Assert.AreEqual(DragOperations.Move, supportedOperations); @@ -185,7 +185,7 @@ { case DragDropTestMethod.CanDrop: // Call - DragOperations supportedOperations = info.CanDrop(draggedItemContext, targetGroupContext, DragOperations.Move); + DragOperations supportedOperations = info.CanDrop(draggedItemContext, targetGroupContext); // Assert Assert.AreEqual(DragOperations.None, supportedOperations);