B4BCore.Internal.ConfigInfo.ReadConfig C# (CSharp) Méthode

ReadConfig() public static méthode

This returns the config for the BundlerForBower. It forms this by reading the default setting from the manifest and then merges in any user config file, if present
public static ReadConfig ( string configFilePath ) : ConfigInfo
configFilePath string
Résultat ConfigInfo
        public static ConfigInfo ReadConfig(string configFilePath)
        {
            var defaultConfigJsonString = ReadDefaultConfigFileFromAssembly();

            if (configFilePath == null || !File.Exists(configFilePath))
                return JsonConvert.DeserializeObject<ConfigInfo>(defaultConfigJsonString);

            var defaultConfigJObject = JObject.Parse(defaultConfigJsonString);
            var userConfigJObject = JObject.Parse(File.ReadAllText(configFilePath));

            defaultConfigJObject.Merge(userConfigJObject);

            return defaultConfigJObject.ToObject<ConfigInfo>();
        }