Exemplo n.º 1
0
 private SettingsService()
 {
     if (!File.Exists (settingsPath)) {
         var defaultSettings = new Settings () {
             HasSeenOnboarding = false,
             Language = "English",
             Location = "Berlin"
         };
         var defaultJson = JsonConvert.SerializeObject (defaultSettings);
         File.WriteAllText (settingsPath, defaultJson);
     }
 }
Exemplo n.º 2
0
 public void PersistSettings(Settings settings)
 {
     var settingsJson = JsonConvert.SerializeObject (settings);
     File.WriteAllText (settingsPath, settingsJson);
 }