コード例 #1
0
        private void buttonLoadConfig_Click(object sender, EventArgs e)
        {
            try
            {
                OpenFileDialog dlg = new OpenFileDialog();
                dlg.InitialDirectory = Application.StartupPath;
                dlg.Filter           = "Xml Files(*.xml)|*.xml";
                if (dlg.ShowDialog(this) == DialogResult.Cancel)
                {
                    return;
                }

                string targetFolder    = string.Empty;
                bool   changeNetMarker = false;
                string from            = string.Empty;
                string to             = string.Empty;
                bool   changeKeyFiles = false;
                string keyFilesFolder = string.Empty;

                ConfigManager.LoadConfigurationFromConfigFile(dlg.FileName, ref targetFolder, ref changeNetMarker, ref from, ref to, ref changeKeyFiles, ref keyFilesFolder);

                textBoxFolder.Text = targetFolder;
                checkBoxChangeNetMarker.Checked = changeNetMarker;
                comboBoxFromNetVersion.Text     = from;
                comboBoxToNetVersion.Text       = to;
                checkBoxChangeKeyFiles.Checked  = changeKeyFiles;
                textBoxKeyFilesRootFolder.Text  = keyFilesFolder;
            }
            catch (Exception exception)
            {
                ExceptionDisplayer.ShowException(this, exception);
            }
        }
コード例 #2
0
        private void buttonSaveConfig_Click(object sender, EventArgs e)
        {
            try
            {
                SaveFileDialog dlg = new SaveFileDialog();
                dlg.InitialDirectory = Application.StartupPath;
                dlg.Filter           = "Xml Files(*.xml)|*.xml";
                if (dlg.ShowDialog(this) == DialogResult.Cancel)
                {
                    return;
                }

                ConfigManager.SaveConfigurationToXMLFile(dlg.FileName, textBoxFolder.Text, checkBoxChangeNetMarker.Checked, comboBoxFromNetVersion.Text, comboBoxToNetVersion.Text, checkBoxChangeKeyFiles.Checked, textBoxKeyFilesRootFolder.Text);
            }
            catch (Exception exception)
            {
                ExceptionDisplayer.ShowException(this, exception);
            }
        }