Created
July 9, 2012 11:50
-
-
Save ronnieoverby/3076031 to your computer and use it in GitHub Desktop.
embedded resources with cassette
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
using System.Reflection; | |
using Cassette; | |
using Cassette.IO; | |
using Cassette.Scripts; | |
using Cassette.Stylesheets; | |
namespace Overby.CMS | |
{ | |
/// <summary> | |
/// Configures the Cassette asset bundles for the web application. | |
/// </summary> | |
public class CassetteBundleConfiguration : IConfiguration<BundleCollection> | |
{ | |
readonly IBundleFactory<ScriptBundle> _scriptBundleFactory; | |
public CassetteBundleConfiguration(IBundleFactory<ScriptBundle> scriptBundleFactory) | |
{ | |
_scriptBundleFactory = scriptBundleFactory; | |
} | |
public void Configure(BundleCollection bundles) | |
{ | |
var scriptBundle = _scriptBundleFactory.CreateBundle( | |
"~/My Bundle", | |
Enumerable.Empty<IFile>(), | |
new BundleDescriptor { AssetFilenames = { "*" } } | |
); | |
scriptBundle.Assets.Add(new ResourceAsset("Overby.MyPortableArea.Content.Scripts.Content.Edit.js", Assembly.GetExecutingAssembly())); | |
bundles.Add(scriptBundle); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment