Exemplo n.º 1
0
 void LoadSettings()
 {
     if (!File.Exists(FolderNames.SettingsJson))
     {
         Console.WriteLine("No " + FolderNames.SettingsJson + " found. Creating one.");
         Settings = new SettingsData();
         File.WriteAllText(FolderNames.SettingsJson, Settings.ToJson());
     }
     else
     {
         using (StreamReader r = new StreamReader(FolderNames.SettingsJson))
         {
             string json = r.ReadToEnd();
             Settings = SettingsData.FromJson(json);
         }
     }
 }