Ejemplo n.º 1
0
 public void LoadSettings()
 {
     try
     {
         // TODO: Refactor for configurable settings and profiles paths
         Settings = JsonConvert.DeserializeObject<SettingsModel>(File.ReadAllText(@"Resources\settings.json"));
         if (Settings == null)
         {
             throw new Exception("Failed to load settings.");
         }
         var profilesDirectory = @"Resources\Profiles\";
         LoadProfiles(Directory.Exists(profilesDirectory)
             ? Directory.GetFiles(profilesDirectory, @"*.json")
             : new string[] { });
     }
     catch
     {
         // TODO: Handle error and display information in the application
         throw;
     }
 }
Ejemplo n.º 2
0
 public SharedSettingsProvider()
 {
     Settings = new SettingsModel();
 }