Exemple #1
0
        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);
            }
        }
Exemple #2
0
        private void _saveScraperConfig(ScraperAirdnaConfigModel config, string configFilename)
        {
            File.WriteAllText(configFilename, JsonConvert.SerializeObject(config, Newtonsoft.Json.Formatting.Indented));

            _log($"Save config:{configFilename} is done");
        }