private void tvModSelection_DragDrop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { string[] filenames = e.Data.GetData(DataFormats.FileDrop, true) as string[]; List <string> accepted = new List <string>(); foreach (string filename in filenames) { string ext = System.IO.Path.GetExtension(filename).ToLower(); if (ext == Constants.EXT_ZIP || ext == Constants.EXT_RAR || ext == Constants.EXT_7ZIP || ext == Constants.EXT_CRAFT) { accepted.Add(filename); } } if (accepted.Count > 0) { ModSelectionController.AddModsAsync(accepted.ToArray()); } } }