Esempio n. 1
0
        public void UseBundle(ComposableBundle <T> bundle)
        {
            // ReSharper disable once UseObjectOrCollectionInitializer
            var collection = new BundleCollection();

            collection.Add(_bundle);

            var resolver = new BundleResolver(collection);
            var content  = resolver.GetBundleContents(_bundle.Path)?.ToList();

            RemoveScripts(content);

            foreach (var virtualPath in bundle.VirtualPaths)
            {
                // Stop the script from being added twice
                if (content != null && content.Contains(virtualPath))
                {
                    continue;
                }
                _bundle.Include(virtualPath);
            }
        }
Esempio n. 2
0
 public static ComposableBundle <T> Add <T>(this BundleCollection bundles, ComposableBundle <T> bundle) where T : Bundle
 {
     bundles.Add(bundle.Bundle);
     return(bundle);
 }