Ejemplo n.º 1
0
        private void _initConfig(ScraperOnmapStateModel state)
        {
            var filename = $"{state.ConfigFilename}";

            if (File.Exists(filename))
            {
                _config = JsonConvert.DeserializeObject <ScraperOnmapConfigModel>(File.ReadAllText(filename));
            }
            else
            {
                _config = new ScraperOnmapConfigModel();
                _saveConfig(_config, filename);
            }
        }
Ejemplo n.º 2
0
 private void _saveConfig(ScraperOnmapConfigModel config, string filename)
 {
     File.WriteAllText(filename, JsonConvert.SerializeObject(config, Formatting.Indented));
 }