public void SaveXML(ConfigureContigencia config) { System.Xml.Serialization.XmlSerializer writer = new System.Xml.Serialization.XmlSerializer(typeof(ConfigureContigencia)); System.IO.StreamWriter file = new System.IO.StreamWriter(@"AppConfigContingencia.xml"); writer.Serialize(file, config); file.Close(); }
public ConfigureContigencia GetConfig() { overview = new ConfigureContigencia(); try { System.Xml.Serialization.XmlSerializer reader = new System.Xml.Serialization.XmlSerializer(typeof(ConfigureContigencia)); System.IO.StreamReader file = new System.IO.StreamReader(@"AppConfigContingencia.xml"); overview = (ConfigureContigencia)reader.Deserialize(file); file.Close(); } catch (Exception e) { WriteXML(); } return overview; }