Esempio n. 1
0
        private static void Main(string[] args)
        {
            try {
                RegistryManager.LoadConfig();
                PreferenceManager.LoadConfig();
            } catch (Exception ex) {
                File.Delete(RegistryManager.ConfigPath);
                File.Delete(PreferenceManager.ConfigPath);
                try {
                    RegistryManager.LoadConfig();
                    PreferenceManager.LoadConfig();
                } catch (Exception ex2) {
                    MessageBox.Show("Failure during loading." + Environment.NewLine + ex2.ToString(),
                                    "Sorry", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                MessageBox.Show(I._("bpmgui_msg_configautoreset", ex.ToString()), "Sorry",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());

            RegistryManager.SaveConfig();
            PreferenceManager.SaveConfig();
        }