Fail on drag drop operations with mixed files.

This commit is contained in:
Dean Herbert 2017-03-06 15:03:58 +09:00
parent 76ef8c1a6c
commit ff51af94ec
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
1 changed files with 3 additions and 3 deletions

View File

@ -78,10 +78,10 @@ private void dragEnter(DragEventArgs e)
if (isFile)
{
var paths = ((object[])e.Data.GetData(DataFormats.FileDrop)).Select(f => f.ToString()).ToArray();
if (paths.Any(p => !allowed_extensions.Any(ext => p.EndsWith(ext))))
e.Effect = DragDropEffects.None;
else
if (allowed_extensions.Any(ext => paths.All(p => p.EndsWith(ext))))
e.Effect = DragDropEffects.Copy;
else
e.Effect = DragDropEffects.None;
}
}
}