static WoWLanguagePack ChooseLanguagePack(WoWInstallation wowInstallation) { CultureInfo desiredCulture = Properties.Settings.Default.LanguagePackCulture; if (wowInstallation.LanguagePacks.Count == 1) { return(wowInstallation.LanguagePacks[0]); } foreach (WoWLanguagePack languagePack in wowInstallation.LanguagePacks) { if (languagePack.Culture == desiredCulture) { return(languagePack); } } using (LanguagePackDialog languagePackDialog = new LanguagePackDialog()) { languagePackDialog.WoWInstallation = wowInstallation; switch (languagePackDialog.ShowDialog()) { case DialogResult.OK: return(languagePackDialog.LanguagePack); default: return(null); } } }
private void OpenWoWFileSystem() { UseWaitCursor = true; Application.DoEvents(); if (fileSystem != null) { fileSystem.Dispose(); } fileSystem = null; try { var wowInstallation = WoWInstallation.Find(); languagePackDialog.WoWInstallation = wowInstallation; foreach (var languagePack in wowInstallation.LanguagePacks) { if (languagePack.Culture == System.Globalization.CultureInfo.CurrentCulture) { languagePackDialog.LanguagePack = languagePack; } } if (wowInstallation.LanguagePacks.Count > 1) { if (languagePackDialog.ShowDialog(this) != DialogResult.OK) { return; } } ClearView(); fileSystem = wowInstallation.CreateFileSystem(languagePackDialog.LanguagePack, false, true); SetTitle(wowInstallation.Path); FillTreeView(); saveAsToolStripMenuItem.Enabled = true; saveAsToolStripButton.Enabled = true; } catch (Exception ex) { ErrorDialog(ex.ToString()); } finally { UseWaitCursor = false; } }