Exemplo n.º 1
0
        internal static void SaveSettings(Settings settings)
        {
            string path = GetSettingsPath();
            string xml  = SimpleXmlSerializer.Serialize(settings);

            File.WriteAllText(path, xml);
        }
Exemplo n.º 2
0
 internal static Settings GetSettings()
 {
     if (currentSettings == null)
     {
         string path = GetSettingsPath();
         string xml;
         if (File.Exists(path))
         {
             xml             = File.ReadAllText(path);
             currentSettings = (Settings)SimpleXmlSerializer.Deserialize(xml);
         }
         else
         {
             currentSettings = Settings.GetDefault();
         }
     }
     return(currentSettings);
 }