public Assets(AssetsConfiguration config) { if (config.CompilerConfiguration == null) { throw new ArgumentException("The compilers were not configured"); } if (config.SourceConfiguration == null) { throw new ArgumentException("The sources were not configured"); } _config = config; _jsManager = config.SourceConfiguration.GetSourceManager(".js"); _cssManager = config.SourceConfiguration.GetSourceManager(".css"); if(config.RouteHandlerFunction == null) { _routeHandler = (pile, file) => new DefaultHandler(file, config).Execute; } else { _routeHandler = (pile, file) => config.RouteHandlerFunction(pile, file, config); } }
public static IAssets Initialise(Func<IAssetsConfiguration, IAssetsConfiguration> configFunc) { var config = new AssetsConfiguration(); _assets = new Assets(configFunc(config)); return _assets; }