private void UpdateAllPrj2GameSettings(DirectoryInfo directory, ProjectLevel detectedLevel) { foreach (FileInfo file in directory.GetFiles("*.prj2", SearchOption.TopDirectoryOnly)) { if (!ProjectLevel.IsBackupFile(file.Name)) { LevelHandling.UpdatePrj2GameSettings(file.FullName, detectedLevel, _ide.Project); } } }
private void UpdateAllPrj2FilesInLevelDirectory(ProjectLevel importedLevel) { string[] files = Directory.GetFiles(importedLevel.FolderPath, "*.prj2", SearchOption.TopDirectoryOnly); progressBar.Visible = true; progressBar.BringToFront(); progressBar.Maximum = files.Length; foreach (string file in files) { if (!ProjectLevel.IsBackupFile(Path.GetFileName(file))) { LevelHandling.UpdatePrj2GameSettings(file, importedLevel, _targetProject); } progressBar.Increment(1); } }
private void UpdateLevelSettings(ProjectLevel importedLevel) { if (radioButton_SpecifiedCopy.Checked) { string specifiedFileName = Path.GetFileName(textBox_Prj2Path.Tag.ToString()); string internalFilePath = Path.Combine(importedLevel.FolderPath, specifiedFileName); LevelHandling.UpdatePrj2GameSettings(internalFilePath, importedLevel, _targetProject); } else if (radioButton_SelectedCopy.Checked) { UpdateAllPrj2FilesInLevelDirectory(importedLevel); } else if (radioButton_FolderKeep.Checked) { DialogResult result = DarkMessageBox.Show(this, "Do you want to update the \"Game\" settings of all the .prj2 files in the\n" + "specified folder to match the project settings?", "Update settings?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { UpdateAllPrj2FilesInLevelDirectory(importedLevel); } } }