Esempio n. 1
0
        private void LoadParamFile()
        {
            string file = conf_file;

            if (System.IO.File.Exists(file))
            {
                try {
                    System.Xml.Serialization.XmlSerializer xml_sr = new System.Xml.Serialization.XmlSerializer(typeof(SettingParams));
                    System.IO.StreamReader sr = new System.IO.StreamReader(file, new System.Text.UTF8Encoding(false));
                    prms = (SettingParams)xml_sr.Deserialize(sr);
                    sr.Close();
                }
                catch
                {
                    prms = new SettingParams();
                    prms.load_default_param();
                    return;
                }
            }
            else
            {
                prms = new SettingParams();
                prms.load_default_param();
            }
        }
Esempio n. 2
0
 private void button_default_Click(object sender, EventArgs e)
 {
     prms.load_default_param();
     parent_form.SaveParamFile();
     parent_form.HotkeyUnregisterAll();
     parent_form.HotkeyRegisterAll();
     this.Close();
     parent_form.ReloadGraphics();
 }