private void StoreParameters(List <string> parameters) { List <CLanFile> batchFiles = CLanFile.GetFiles(parameters); // The dispatcher is needed because this method is called from a separated thread Current.Dispatcher.Invoke(() => { batchFiles.ForEach(SelectedFiles.Add); }); }
// A common method that handles both selection of files and folders. The interaction // logic is the same in both cases, the only different thing is how the CommonOpenFileDialog // is instantiated. private void selectFilesOrFolders(CommonOpenFileDialog cofd) { CommonFileDialogResult result = cofd.ShowDialog(); if (result != CommonFileDialogResult.Ok) { return; } // The list of entries selected by the user List <String> sFiles = new List <string>(cofd.FileNames); // Converts the list of filenames to actual CLanFile objects, expanding the directory structure if needed files = CLanFile.GetFiles(sFiles); selectionButtonBox.Visibility = Visibility.Hidden; continueButtonBox.Visibility = Visibility.Visible; }