private async void DropOnClick(object sender, EventArgs eventArgs) { if (this.convertProgress.Visible) { return; } var ofd = new OpenFileDialog { CheckFileExists = true, Multiselect = true, Filter = "Image files (*.flif, *.png)|*.flif;*.png", }; var result = ofd.ShowDialog(this); if (result == DialogResult.OK) { this.convertProgress.Visible = true; await ConvertProvider.Convert(this.convertProgress, ofd.FileNames.ToList()); this.convertProgress.Visible = false; } ofd.Dispose(); }
private async void MainForm_DragDrop(object sender, DragEventArgs e) { if (this.convertProgress.Visible) { return; } var paths = e.Data.GetData(DataFormats.FileDrop) as string[]; if (paths == null || !paths.Any()) { return; } this.convertProgress.Visible = true; await ConvertProvider.Convert(this.convertProgress, paths.ToList()); this.convertProgress.Visible = false; }