private async void ReceiveFiles(object sender, DragEventArgs dragEventArgs) { if (_processing) { MessageBox.Show(this, ScanlationTools.Resources.BusyPleaseAwait, ScanlationTools.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } if (_selectedFunction == SelectableFunctions.None) { MessageBox.Show(this, ScanlationTools.Resources.PleaseSelectFunction, ScanlationTools.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } if (_selectedOutputFormat == SelectableOutputFormats.None) { MessageBox.Show(this, ScanlationTools.Resources.PleaseSelectOutputFormat, ScanlationTools.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } var folderDialog = new VistaFolderBrowserDialog { ShowNewFolderButton = true }; folderDialog.ShowDialog(this); if (string.IsNullOrWhiteSpace(folderDialog.SelectedPath)) { MessageBox.Show(this, ScanlationTools.Resources.PleaseSelectOutputPath, ScanlationTools.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } var location = new DirectoryInfo(folderDialog.SelectedPath); var images = (await ImageIO.FetchImages(((string[])dragEventArgs.Data.GetData(DataFormats.FileDrop)).Select(path => new FileInfo(path)))).ToArray(); if (!images.Any()) { MessageBox.Show(this, ScanlationTools.Resources.NoSupportedImageFormatFound, ScanlationTools.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } switch (_selectedFunction) { case SelectableFunctions.Converter: await RunFunction("Converter", null, images, location); break; case SelectableFunctions.Resizer: var resizerDialog = new InsertTextDialog(ScanlationTools.Resources.Resizer, ScanlationTools.Resources.InsertResizePercentage, true); resizerDialog.ShowDialog(); if (resizerDialog.Input == null) { MessageBox.Show(this, ScanlationTools.Resources.InvalidValueInserted, ScanlationTools.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } await RunFunction("Resizer", new [] { (name : "percentage", value : resizerDialog.Input) }, images, location);