Пример #1
0
        private void editPathsMenuItem_Click(object sender, EventArgs e)
        {
            EditPathsForm editPathsForm = new EditPathsForm();

            if (editPathsForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                editPathsForm.saveSettings();
            }
        }
Пример #2
0
        public void initializeSettings()
        {
            if (!File.Exists("settings.xml"))
            {
                EditPathsForm editPathsForm = new EditPathsForm();
                if (editPathsForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    editPathsForm.saveSettings();
                }
            }

            if (File.Exists("settings.xml"))
            {
                XDocument doc = XDocument.Load("settings.xml");
                XElement settings = doc.Element("Settings");

                debugGamePath = settings.Attribute("game_debug_path").Value;
                releaseGamePath = settings.Attribute("game_release_path").Value;
                resourcesSourcePath = settings.Attribute("resources_source_path").Value;
            }
            else
            {
                initializeSettings();
            }
        }