mirror of
https://github.com/ShareX/ShareX.git
synced 2024-08-19 04:02:07 +12:00
Support dragging multiple items
This commit is contained in:
parent
2c65d618dc
commit
063bc70fb7
1 changed files with 5 additions and 9 deletions
|
@ -1278,18 +1278,14 @@ private void lvUploads_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
|
||||||
private void lvUploads_ItemDrag(object sender, ItemDragEventArgs e)
|
private void lvUploads_ItemDrag(object sender, ItemDragEventArgs e)
|
||||||
{
|
{
|
||||||
ListViewItem item = e.Item as ListViewItem;
|
TaskInfo[] taskInfos = GetCurrentTasks().Select(x => x.Info).Where(x => x != null && !string.IsNullOrEmpty(x.FilePath) && File.Exists(x.FilePath)).ToArray();
|
||||||
|
|
||||||
if (item != null)
|
if (taskInfos.Length > 0)
|
||||||
{
|
{
|
||||||
WorkerTask task = item.Tag as WorkerTask;
|
AllowDrop = false;
|
||||||
|
|
||||||
if (task != null && task.Info != null && !string.IsNullOrEmpty(task.Info.FilePath) && File.Exists(task.Info.FilePath))
|
IDataObject dataObject = new DataObject(DataFormats.FileDrop, taskInfos.Select(x => x.FilePath).ToArray());
|
||||||
{
|
lvUploads.DoDragDrop(dataObject, DragDropEffects.Copy);
|
||||||
AllowDrop = false;
|
|
||||||
|
|
||||||
lvUploads.DoDragDrop(new DataObject(DataFormats.FileDrop, new string[] { task.Info.FilePath }), DragDropEffects.Copy);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue