mirror of https://github.com/ppy/osu
Fail on drag drop operations with mixed files.
This commit is contained in:
parent
76ef8c1a6c
commit
ff51af94ec
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue