/// <summary> /// Saves the config file /// </summary> /// <param name="config">The config file to save</param> /// <param name="configPath">The path of the config file</param> public static void Save(ConfigOptions config, string configPath) { JsonSerializerSettings settings = new JsonSerializerSettings() { Formatting = Formatting.Indented, ContractResolver = new DefaultContractResolver { NamingStrategy = new CamelCaseNamingStrategy() } }; File.WriteAllText(configPath, JsonConvert.SerializeObject(config, settings)); }
/// <summary> /// Saves the config options /// </summary> /// <param name="options">The config options to save</param> /// <param name="toPath">The path to save to</param> public void Save(IConfigOptions options, string toPath) { ConfigOptions configOpts = options as ConfigOptions; ConfigParser.Save(configOpts, toPath); }
/// <summary> /// Saves the config file /// </summary> /// <param name="config">The config file to save</param> /// <param name="configPath">The path of the config file</param> public static void Save(ConfigOptions config, string configPath) { File.WriteAllText(configPath, JsonConvert.SerializeObject(config, Formatting.Indented)); }
/// <summary> /// Gets the filepath for a given project /// </summary> /// <param name="projPath">The project path</param> /// <returns>Returns the config file for that project</returns> public static ConfigOptions GetForProject(string projPath) { ConfigOptions config = ParseFromFile(GetConfigFilepath(projPath)); return(config); }