Example #1
0
        /// <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));
        }
Example #2
0
        /// <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);
        }
Example #3
0
 /// <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));
 }
Example #4
0
        /// <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);
        }