public ISmidgeRequire RequiresCss(CssFile file) { if (_type == WebFileType.Js) throw new InvalidOperationException("Cannot add js file to a css bundle"); if (FileSystemHelper.IsExternalRequestPath(file.FilePath)) throw new InvalidOperationException("Cannot process an external file as part of a bundle"); _bundleManager.AddToBundle(_bundleName, file); return this; }
/// <summary> /// Adds an item to the bundle, if the bundle doesn't exist it will be created /// </summary> /// <param name="bundleName"></param> /// <param name="file"></param> public void AddToBundle(string bundleName, CssFile file) { BundleFileCollection collection; if (_bundles.TryGetValue(bundleName, out collection)) { collection.Files.Add(file); } else { _bundles.Create(bundleName, file); } }
/// <summary> /// Adds an item to the bundle, if the bundle doesn't exist it will be created /// </summary> /// <param name="bundleName"></param> /// <param name="file"></param> public void AddToBundle(string bundleName, CssFile file) { List<IWebFile> files; if (_bundles.TryGetValue(bundleName, out files)) { files.Add(file); } else { _bundles.Create(bundleName, file); } }
public ISmidgeRequire RequiresCss(CssFile file) { _context.Files.Add(file); return this; }
public ISmidgeRequire RequiresCss(CssFile file) { return this; }
public SmidgeHelper RequiresCss(CssFile file) { _context.Files.Add(file); return this; }