Ejemplo n.º 1
0
        public static void SaveToXml(string filePath, SettingsManager sourceObj)
        {
            try {
                    using (StreamWriter writer = new StreamWriter(filePath)) {
                        System.Xml.Serialization.XmlSerializer xmlSerializer =
                            new System.Xml.Serialization.XmlSerializer(sourceObj.GetType());
                        xmlSerializer.Serialize(writer, sourceObj);
                }

                } catch(Exception ex) {
                    MessageBox.Show(ex.Message);
                }
        }
Ejemplo n.º 2
0
 public static void SaveToXml(string filePath, SettingsManager sourceObj)
 {
     try
     {
         using (StreamWriter writer = new StreamWriter(filePath))
         {
             new XmlSerializer(sourceObj.GetType()).Serialize((TextWriter) writer, sourceObj);
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message);
     }
 }
Ejemplo n.º 3
0
 public static void loadConfig()
 {
     sm = SettingsManager.LoadFromXml("ntrconfig.xml");
     sm.init();
 }