private void _loadScraperConfig(ScraperAirdnaStateModel state) { var configFilename = state.ConfigFilename; if (File.Exists(configFilename)) { _config = JsonConvert.DeserializeObject <ScraperAirdnaConfigModel>(File.ReadAllText(configFilename)); } else { _config = new ScraperAirdnaConfigModel(); _saveScraperConfig(_config, configFilename); } }
private void _saveScraperConfig(ScraperAirdnaConfigModel config, string configFilename) { File.WriteAllText(configFilename, JsonConvert.SerializeObject(config, Newtonsoft.Json.Formatting.Indented)); _log($"Save config:{configFilename} is done"); }