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(); } }
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(); }