Delay d&d file deletion

Gives web browser programs enough time to acquire the data since the
file isn't being moved to a location on the user's local storage.
This commit is contained in:
Kaphotics 2016-07-10 10:35:44 -07:00
parent 250fc15f14
commit 109bd291f6

View file

@ -3229,8 +3229,15 @@ namespace PKHeX
}
catch (ArgumentException x)
{ Util.Error("Drag & Drop Error:", x.ToString()); }
File.Delete(newfile);
pkm_from_offset = 0;
// Browser apps need time to load data since the file isn't moved to a location on the user's local storage.
// Tested 10ms -> too quick, 100ms was fine. 500ms should be safe?
new Thread(() =>
{
Thread.Sleep(500);
File.Delete(newfile);
}).Start();
}
private void pbBoxSlot_DragDrop(object sender, DragEventArgs e)
{