mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-15 11:26:36 +12:00
Support dragging multiple items
This commit is contained in:
parent
2c65d618dc
commit
063bc70fb7
|
@ -1278,18 +1278,14 @@ private void lvUploads_KeyDown(object sender, KeyEventArgs 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)
|
||||
{
|
||||
WorkerTask task = item.Tag as WorkerTask;
|
||||
|
||||
if (task != null && task.Info != null && !string.IsNullOrEmpty(task.Info.FilePath) && File.Exists(task.Info.FilePath))
|
||||
if (taskInfos.Length > 0)
|
||||
{
|
||||
AllowDrop = false;
|
||||
|
||||
lvUploads.DoDragDrop(new DataObject(DataFormats.FileDrop, new string[] { task.Info.FilePath }), DragDropEffects.Copy);
|
||||
}
|
||||
IDataObject dataObject = new DataObject(DataFormats.FileDrop, taskInfos.Select(x => x.FilePath).ToArray());
|
||||
lvUploads.DoDragDrop(dataObject, DragDropEffects.Copy);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue