Fixed bug where connections/containers could be dragged between putty session nodes

This commit is contained in:
David Sparer
2016-09-21 10:38:41 -06:00
parent cbe0c1a550
commit 2b6367a8a9
2 changed files with 20 additions and 0 deletions

View File

@@ -155,6 +155,24 @@ namespace mRemoteNGTests.Tree
Assert.That(dragDropEffects, Is.EqualTo(DragDropEffects.None));
}
[Test]
public void CantDragNodeAbovePuttySessionNodes()
{
var source = _connection1;
var target = new PuttySessionInfo();
var dragDropEffects = _dragAndDropHandler.CanModelDrop(source, target, DropTargetLocation.AboveItem);
Assert.That(dragDropEffects, Is.EqualTo(DragDropEffects.None));
}
[Test]
public void CantDragNodeBelowPuttySessionNodes()
{
var source = _connection1;
var target = new PuttySessionInfo();
var dragDropEffects = _dragAndDropHandler.CanModelDrop(source, target, DropTargetLocation.BelowItem);
Assert.That(dragDropEffects, Is.EqualTo(DragDropEffects.None));
}
[Test]
public void DraggingNodeBelowSiblingRearrangesTheUnderlyingModelCorrectly()
{

View File

@@ -112,6 +112,8 @@ namespace mRemoteNG.Tree
var dragDropEffect = DragDropEffects.None;
if (AncestorDraggingOntoChild(dropSource, dropTarget))
_infoMessage = Language.strNodeCannotDragParentOnChild;
else if (dropTarget is PuttySessionInfo || dropTarget is RootPuttySessionsNodeInfo)
_enableFeedback = false;
else
{
dragDropEffect = DragDropEffects.Move;