C# Class B4BCore.BundlerForBower

This class contains extention methods to produce html strings to include CSS or JavaScript files in a HTML page
Exibir arquivo Open project: JonPSmith/MvcUsingBower Class Usage Examples

Public Methods

Method Description
BundlerForBower ( string jsonDataDir, string>.Func getAbsPathFromVirtualPath, string>.Func getChecksumFromRelPath ) : System

This creates the class ready for bundling

CalculateHtmlIncludes ( string bundleName, CssOrJs cssOrJs, bool inDevelopment, string>.Func getContentUrl ) : string

This returns the appropriate html string to include in the web page such that the requested bundle will be loaded.

FormStaticFileWithCacheBuster ( string absFileUrl, string cacheBusterValue ) : string

This returns a file reference with a cachebuster value added.

Private Methods

Method Description
FormCdnIncludes ( IEnumerable cdnLinks, string bundleName, CssOrJs cssOrJs, FileTypeConfigInfo fileTypeInfo, string>.Func getContentUrl ) : string
FormSingleMinifiedFileInclude ( string bundleName, CssOrJs cssOrJs, FileTypeConfigInfo fileTypeInfo, string>.Func getContentUrl ) : string

Method Details

BundlerForBower() public method

This creates the class ready for bundling
public BundlerForBower ( string jsonDataDir, string>.Func getAbsPathFromVirtualPath, string>.Func getChecksumFromRelPath ) : System
jsonDataDir string The absolute directory path to the folder that holds the BowerBundles.json and the /// optional BundlerForBower.json config file
getAbsPathFromVirtualPath string>.Func This is a function which given a path relative to the MVC project /// will return the absolute path. In MVC5 this is provided by System.Web.Hosting.HostingEnvironment.MapPath.
getChecksumFromRelPath string>.Func This is a function returns a checksum of a file referred to via an relative path /// Can be null, in which case no checksum can be used.
return System

CalculateHtmlIncludes() public method

This returns the appropriate html string to include in the web page such that the requested bundle will be loaded.
public CalculateHtmlIncludes ( string bundleName, CssOrJs cssOrJs, bool inDevelopment, string>.Func getContentUrl ) : string
bundleName string
cssOrJs CssOrJs
inDevelopment bool This controls whether we supply individual files or development mode /// or single minified files/CDNs in non-development mode
getContentUrl string>.Func method to get url of content
return string

FormStaticFileWithCacheBuster() public method

This returns a file reference with a cachebuster value added.
public FormStaticFileWithCacheBuster ( string absFileUrl, string cacheBusterValue ) : string
absFileUrl string
cacheBusterValue string
return string