Merge pull request #1899 from ianselmi/develop

Enable multi items drag&drop
This commit is contained in:
Dimitrij
2021-06-19 09:31:13 +01:00
committed by GitHub
2 changed files with 14 additions and 9 deletions

View File

@@ -22,8 +22,11 @@ namespace mRemoteNG.Tree
public void HandleEvent_ModelDropped(object sender, ModelDropEventArgs e)
{
if (!(e.TargetModel is ConnectionInfo dropTarget)) return;
var dropSource = (ConnectionInfo)e.SourceModels[0];
DropModel(dropSource, dropTarget, e.DropTargetLocation);
foreach(var dropSource in e.SourceModels.Cast<ConnectionInfo>())
{
DropModel(dropSource, dropTarget, e.DropTargetLocation);
}
e.Handled = true;
}
@@ -72,13 +75,15 @@ namespace mRemoteNG.Tree
_enableFeedback = true;
_currentFeedbackColor = DropDeniedFeedbackColor;
_infoMessage = null;
var dropSource = e.SourceModels.Cast<ConnectionInfo>().First();
var dropTarget = e.TargetModel as ConnectionInfo;
foreach (var dropSource in e.SourceModels.Cast<ConnectionInfo>())
{
var dropTarget = e.TargetModel as ConnectionInfo;
e.Effect = CanModelDrop(dropSource, dropTarget, e.DropTargetLocation);
e.InfoMessage = _infoMessage;
e.DropSink.EnableFeedback = _enableFeedback;
e.DropSink.FeedbackColor = _currentFeedbackColor;
e.Effect = CanModelDrop(dropSource, dropTarget, e.DropTargetLocation);
e.InfoMessage = _infoMessage;
e.DropSink.EnableFeedback = _enableFeedback;
e.DropSink.FeedbackColor = _currentFeedbackColor;
}
e.Handled = true;
}

View File

@@ -55,7 +55,7 @@ namespace mRemoteNG.UI.Window
this.ConnectionTree.IsSimpleDragSource = true;
this.ConnectionTree.LabelEdit = true;
this.ConnectionTree.Location = new System.Drawing.Point(0, 24);
this.ConnectionTree.MultiSelect = false;
this.ConnectionTree.MultiSelect = true;
this.ConnectionTree.Name = "ConnectionTree";
this.ConnectionTree.NodeDeletionConfirmer = alwaysConfirmYes2;
this.ConnectionTree.PostSetupActions = new IConnectionTreeDelegate[0];