Пример #1
0
        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; }
        }
Пример #2
0
        static WoWInstallation FindWoWInstallation()
        {
            WoWInstallation wowInstallation = null;

            // Try to find a valid wow installation
            try { wowInstallation = WoWInstallation.Find(); }
            catch (DirectoryNotFoundException)
            {
                // If we can't find wow, terminate here
                MessageBox.Show(Properties.Resources.CannotFindWow, Properties.Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, Properties.Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }

            return(wowInstallation);
        }
Пример #3
0
 public MpqFileReader() : this(WoWInstallation.Find())
 {
 }