private void ConvertOsageSkinParameters(BinaryFormat format) { var filePaths = ModuleImportUtilities.SelectModuleImportMultiselect <OsageSkinParameterSet>( "Select file(s) to convert."); if (filePaths == null) { return; } using (var folderBrowserDialog = new VistaFolderBrowserDialog { Description = "Select a folder to save file(s) to.", UseDescriptionForTitle = true }) { if (folderBrowserDialog.ShowDialog(this) != DialogResult.OK) { return; } new Thread(() => { try { Invoke(new Action(() => Enabled = false)); string extension = format.IsModern() ? ".osp" : ".txt"; foreach (string filePath in filePaths) { var ospSet = BinaryFile.Load <OsageSkinParameterSet>(filePath); ospSet.Format = format; ospSet.Save(Path.Combine(folderBrowserDialog.SelectedPath, Path.GetFileNameWithoutExtension(filePath) + extension)); } } finally { Invoke(new Action(() => Enabled = true)); } }).Start(); } }