Пример #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)
     {
         BugReporter br = new BugReporter(ex, "XML save exception");
     }
 }
Пример #2
0
 public static void LoadConfig()
 {
     Sm = SettingsManager.LoadFromXml("ntrconfig.xml");
     Sm.Init();
 }