mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-25 19:38:37 +08:00
Fixed bug where connections/containers could be dragged between putty session nodes
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user