public static ClassOptions load(string config_file_name) { try { return((ClassOptions)XML_access.XMLDeserializeObject(config_file_name, typeof(ClassOptions))); } catch { return(new ClassOptions()); } }
public bool save(string config_file_name) { try { XML_access.XMLSerializeObject(config_file_name, this, typeof(ClassOptions)); return(true); } catch (Exception e) { System.Windows.Forms.MessageBox.Show(e.Message, "Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); return(false); } }
public static ClassInterfaceLanguage load(string config_file_name) { try { if (System.IO.Path.GetFileNameWithoutExtension(config_file_name) == "")// don't show error if application is run for first time { return(new ClassInterfaceLanguage()); } return((ClassInterfaceLanguage)XML_access.XMLDeserializeObject(config_file_name, typeof(ClassInterfaceLanguage))); } catch (Exception e) { System.Windows.Forms.MessageBox.Show("Error loading interface language file " + config_file_name + ".\r\n" + e.Message + "\r\nDefault language will be used for interface", "Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); return(new ClassInterfaceLanguage()); } }