private void MainTreeView_DragDrop(object sender, DragEventArgs e)
{
List<string> DroppedFiles = new List<string>((string[])e.Data.GetData(DataFormats.FileDrop, false));
List<string> ValidDrops = new List<string>();
List<string> Invalids = new List<string>();
// KFreon: Check valid files
foreach (string file in DroppedFiles)
switch (Path.GetExtension(file).ToLowerInvariant())
{
case ".tpf":
case ".metpf":
case ".dds":
case ".def":
case ".txt":
case ".log":
case ".mod":
case ".tga":
case ".jpg":
case ".png":
case ".bmp":
ValidDrops.Add(file);
break;
default:
Invalids.Add(file);
break;
}
// KFreon: Notify if some are invalid
if (Invalids.Count > 0)
MessageBox.Show("The following files are not TPFTools things:" + Environment.NewLine + string.Join(Environment.NewLine, Invalids.ToArray()), "You have failed. We will find another.");
BeginLoadingFiles(ValidDrops);
}