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; } }
public SharedSettingsProvider() { Settings = new SettingsModel(); }