Beispiel #1
0
        private void buttonImport_Click(object sender, EventArgs e)
        {
            OpenFileDialog opf = new OpenFileDialog();

            opf.Filter = "micado settings (*.xml)|*.xml|All files (*.*)|*.*";
            opf.Title  = "Import Micado Settings";

            if (opf.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            string filepath = opf.FileName;

            Settings settings = Settings.ImportSettings(filepath);

            if (settings != null)
            {
                LoadSettings(settings);
            }
            else
            {
                MessageBox.Show("The provided file is not a valid micado settings file.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);;
            }
        }