Example #1
0
 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;
 }
Example #2
0
 /// <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);
     }
 }
Example #3
0
 /// <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);
     }
 }
Example #4
0
 public ISmidgeRequire RequiresCss(CssFile file)
 {
     _context.Files.Add(file);
     return this;
 }
Example #5
0
 public ISmidgeRequire RequiresCss(CssFile file)
 {
     return this;
 }
Example #6
0
 public SmidgeHelper RequiresCss(CssFile file)
 {
     _context.Files.Add(file);
     return this;
 }