コード例 #1
0
 internal static bool MustMinify(IResourceElementGroupConfiguration resourceElementGroupConfiguration, ResourceElement resourceElement)
 {
     return (resourceElement.Minify.HasValue && resourceElement.Minify.Value) ||
            (!resourceElement.Minify.HasValue && resourceElementGroupConfiguration.Minify);
 }
コード例 #2
0
        internal string MinifyAndCombineResources(IResourceElementGroupConfiguration resourceElementGroupConfiguration, ResourceType resourceType, IList<ResourceReadInfo> resources)
        {
            StringBuilder stringBuilder = new StringBuilder();
            for (int i = 0; i < resources.Count; i++)
            {
                ResourceReadInfo resource = resources[i];
                string content = MustMinify(resourceElementGroupConfiguration, resource.ResourceElement) ? MinifyContent(resourceType, resource.ResourceInfo.Content) : resource.ResourceInfo.Content;
                stringBuilder.Append(content);
            }

            return stringBuilder.ToString();
        }