/// <summary> /// The config class has default values set, that can be set by web.config or a json file. /// GZipBundleConfig allows each bundle to have its configuration set on a per bundle basis instead of globally. /// Uses global values for missing properties from either web.config or a json file. /// </summary> /// <param name="clone">GZipBundleConfig to use to build the configuration from.</param> /// <returns>Bundle Configuration</returns> public GZipBundleConfig LoadConfig(GZipBundleConfig clone) { Container = clone.Container; VirtualPath = clone.VirtualPath; AzureAccessKey = string.IsNullOrEmpty(clone.AzureAccessKey) ? Config.AzureAccessKey : clone.AzureAccessKey; AzureAccountName = string.IsNullOrEmpty(clone.AzureAccountName) ? Config.AzureAccountName : clone.AzureAccountName; CdnPath = string.IsNullOrEmpty(clone.CdnPath) ? Config.CdnPath : clone.CdnPath; SecureCdnPath = string.IsNullOrEmpty(clone.SecureCdnPath) ? Config.SecureCdnPath : clone.SecureCdnPath; BundleCacheTTL = clone.BundleCacheTTL == 0 ? Config.BundleCacheTTL : clone.BundleCacheTTL; CachePollTime = clone.CachePollTime == 0 ? Config.CachePollTime : clone.CachePollTime; UseCompression = clone.UseCompression.HasValue ? clone.UseCompression.Value : Config.UseCompression; BlobStorage = string.IsNullOrEmpty(clone.AzureAccountName) || string.IsNullOrEmpty(clone.AzureAccessKey) ? Config.BlobStorage : new Storage(clone.AzureAccountName, clone.AzureAccessKey); return(this); }
/// <summary> /// Creates a copy of the configuration object for the bundle. /// </summary> /// <param name="clone"></param> /// <returns>Bundle Configuration</returns> public GZipBundleConfig(GZipBundleConfig clone) { LoadConfig(this); }