本文整理汇总了C#中Bundle.AddFile方法的典型用法代码示例。如果您正苦于以下问题:C# Bundle.AddFile方法的具体用法?C# Bundle.AddFile怎么用?C# Bundle.AddFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bundle
的用法示例。
在下文中一共展示了Bundle.AddFile方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetDefaultBundle
public static void SetDefaultBundle(this BundleCollection bundles)
{
#region CSS Bundle
var defaultCSSs = new Bundle("~/Content/themes/base/css/css", new CssMinify());
//main CSS
defaultCSSs.AddFile("~/Content/themes/base/css/main.css");
//bootstarp CSS files
defaultCSSs.AddFile("~/Content/themes/base/css/bootstrap.css");
defaultCSSs.AddFile("~/Content/themes/base/css/bootstrap-responsive.css");
//CSS file for bootstrap-datepicker
defaultCSSs.AddFile("~/Content/themes/base/css/datepicker.css");
bundles.Add(defaultCSSs);
#endregion
#region JavaScript Bundle
var defaultJSs = new Bundle("~/Content/themes/base/js/js", new JsMinify());
//load jQuery library
defaultJSs.AddFile("~/Content/themes/base/js/jquery-1.7.2.min.js");
//bootstrap JS files
defaultJSs.AddFile("~/Content/themes/base/js/bootstrap.js");
//bootstrap-datepicker
defaultJSs.AddFile("~/Content/themes/base/js/bootstrap-datepicker.js");
bundles.Add(defaultJSs);
#endregion
}
示例2: RegisterBundles
private static void RegisterBundles(BundleCollection bundles)
{
var css = new Bundle("~/css");
css.AddFile("~/assets/css/vendor/bootstrap-2.0.2.css");
css.AddFile("~/assets/css/vendor/codemirror-2.23.css");
css.AddFile("~/assets/css/vendor/codemirror-neat-2.23.css");
css.AddFile("~/assets/css/compilify.css");
bundles.Add(css);
var js = new Bundle("~/js");
js.AddFile("~/assets/js/vendor/json2.js");
js.AddFile("~/assets/js/vendor/underscore-1.3.1.js");
js.AddFile("~/assets/js/vendor/backbone-0.9.2.js");
js.AddFile("~/assets/js/vendor/bootstrap-2.0.2.js");
js.AddFile("~/assets/js/vendor/codemirror-2.23.js");
js.AddFile("~/assets/js/vendor/codemirror-clike-2.23.js");
js.AddFile("~/assets/js/vendor/jquery.signalr.js");
js.AddFile("~/assets/js/vendor/shortcut.js");
js.AddFile("~/assets/js/compilify.js");
bundles.Add(js);
if (!HttpContext.Current.IsDebuggingEnabled) {
css.Transform = new CssMinify();
js.Transform = new JsMinify();
}
}
示例3: Application_Start
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
// Use LocalDB for Entity Framework by default
Database.DefaultConnectionFactory = new SqlConnectionFactory("Data Source=(localdb)\v11.0; Integrated Security=True; MultipleActiveResultSets=True");
RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
var libBundle = new Bundle("~/Scripts/lib/js", new JsMinify());
libBundle.AddDirectory("~/Scripts/lib", "*.js", true);
BundleTable.Bundles.Add(libBundle);
#if DEBUG
var srcBundle = new Bundle("~/Scripts/src/js", new NoTransform("text/javascript"));
#else
var srcBundle = new Bundle("~/Scripts/src/js", new JsMinify());
#endif
srcBundle.AddFile("~/Scripts/src/SketchPad.knockout.js");
srcBundle.AddFile("~/Scripts/src/SketchPad.js");
srcBundle.AddDirectory("~/Scripts/src", "*.js", true);
BundleTable.Bundles.Add(srcBundle);
BundleTable.Bundles.RegisterTemplateBundles();
}
示例4: CreateJsBundle
private Bundle CreateJsBundle()
{
Bundle bundle = new Bundle("~/Scripts/js", new JsMinify());
bundle.AddFile("~/Scripts/jquery-1.6.2.js");
bundle.AddFile("~/Scripts/jquery.templ.js");
bundle.AddFile("~/Scripts/gScroll.js");
return bundle;
}
示例5: BuildBackboneJsBundle
private Bundle BuildBackboneJsBundle()
{
var backboneBundle = new Bundle("~/Scripts/backbone", new JsMinify());
backboneBundle.AddFile("~/Scripts/underscore.js", true);
backboneBundle.AddFile("~/Scripts/backbone.js", true);
return backboneBundle;
}
示例6: Setup
public void Setup()
{
var mainCssBundle = new Bundle("~/Include/Cache/main.cssbundle.style", typeof(YuiCssMinify));
mainCssBundle.AddFile("~/Include/Styles/bootstrap/bootstrap.min.css");
mainCssBundle.AddFile("~/Include/Styles/bootstrap/bootstrap-responsive.min.css");
mainCssBundle.AddFile("~/Include/Styles/base/core.style.css");
BundleTable.Bundles.Add(mainCssBundle);
}
示例7: BuildBootstrapCssBundle
private Bundle BuildBootstrapCssBundle()
{
var bootstrapBundle = new Bundle("~/Content/bootstrap/css", new CssMinify());
bootstrapBundle.AddFile("~/Content/bootstrap/bootstrap.css", true);
bootstrapBundle.AddFile("~/Content/bootstrap/bootstrap-responsive.css", true);
bootstrapBundle.AddFile("~/Content/bootstrap/bootstrap-custom.css", true);
return bootstrapBundle;
}
示例8: EnableReportingBundle
public static void EnableReportingBundle(this BundleCollection bundles)
{
//it looks like there is a parsing error when files are combined
var reportJs = new Bundle("~/reports/js", new JsMinify());
reportJs.AddFile("~/Scripts/raphael.js");
reportJs.AddFile("~/Scripts/g.raphael.js");
reportJs.AddFile("~/Scripts/g.line.js");
reportJs.AddFile("~/Scripts/date.format.js");
bundles.Add(reportJs);
}
示例9: EnableBootstrapBundle
public static void EnableBootstrapBundle(this BundleCollection bundles)
{
var bootstrapCss = new Bundle("~/bootstrap/css", new CssMinify());
bootstrapCss.AddFile("~/content/bootstrap.css");
bootstrapCss.AddFile("~/content/bootstrap-responsive.css");
bundles.Add(bootstrapCss);
var bootstrapJs = new Bundle("~/bootstrap/js", new JsMinify());
bootstrapJs.AddFile("~/scripts/bootstrap.js");
bundles.Add(bootstrapJs);
}
示例10: AddBundles
static void AddBundles()
{
var jsBundle = new Bundle("~/js", new NoTransform());
jsBundle.AddFile("~/Scripts/jquery-1.7.2.min.js");
jsBundle.AddFile("~/Scripts/bootstrap.min.js");
BundleTable.Bundles.Add(jsBundle);
var cssBundle = new Bundle("~/css", new NoTransform());
cssBundle.AddFile("~/Content/bootstrap.min.css");
BundleTable.Bundles.Add(cssBundle);
var responsiveCssBundle = new Bundle("~/rcss", new NoTransform());
responsiveCssBundle.AddFile("~/Content/bootstrap-responsive.min.css");
BundleTable.Bundles.Add(responsiveCssBundle);
}
示例11: AddJavascriptBundle
private static void AddJavascriptBundle(string path, IEnumerable<string> files)
{
Bundle bundle = new Bundle(path, new JsMinify());
foreach (var f in files)
bundle.AddFile(f);
AddBundle(bundle);
}
示例12: BuildBootstrapJsBundle
private Bundle BuildBootstrapJsBundle()
{
var bootstrapBundle = new Bundle("~/Scripts/bootstrap", new JsMinify());
bootstrapBundle.AddFile("~/Scripts/bootstrap.js");
return bootstrapBundle;
}
示例13: RegisterArea
public override void RegisterArea(AreaRegistrationContext context)
{
if (context == null) throw new ArgumentNullException("context");
context.MapRoute(
"Cases_default",
"Cases/{*all}",
new {Controller = "Cases", action = "Index"});
// Declare BundleTransforms (based on current build configuration)
#if DEBUG
IBundleTransform jsTrans = new NoTransform("text/javascript");
IBundleTransform cssTrans = new NoTransform("text/css");
#else
IBundleTransform jsTrans = new JsMinify();
IBundleTransform cssTrans = new CssMinify();
#endif
Bundle casesViewModels = new Bundle("~/Cases/js", jsTrans);
casesViewModels.AddFile("~/Areas/Cases/Scripts/cases.js", false);
casesViewModels.AddDirectory("~/Areas/Cases/ViewModels","*.js");
BundleTable.Bundles.Add(casesViewModels);
Bundle casesCss = new Bundle("~/Cases/css", cssTrans);
casesCss.AddFile("~/Areas/Cases/Content/cases.css", false);
BundleTable.Bundles.Add(casesCss);
}
示例14: EnableBootstrapBundle
public static void EnableBootstrapBundle(this BundleCollection bundles)
{
var bootstrapCss = new Bundle("~/content/css", new CssMinify());
bootstrapCss.AddFile("~/content/bootstrap.css");
bootstrapCss.AddFile("~/content/bootstrap-responsive.css");
bootstrapCss.AddFile("~/content/site.css");
bundles.Add(bootstrapCss);
var bootstrapJs = new Bundle("~/js", new JsMinify());
bootstrapJs.AddFile("~/scripts/jquery-1.7.1.min.js");
bootstrapJs.AddFile("~/scripts/jquery.validate.min.js");
bootstrapJs.AddFile("~/scripts/jquery.validate.unobtrusive.min.js");
bootstrapJs.AddFile("~/scripts/bootstrap.js");
bundles.Add(bootstrapJs);
}
示例15: Application_Start
void Application_Start(object sender, EventArgs e)
{
var js = new Bundle("~/Scripts/app.js", typeof(JsNullTransform));
js.AddDirectory("~/JavaScript/Models", "*.js", true);
js.AddDirectory("~/JavaScript/Views", "*.js", true);
js.AddFile("~/JavaScript/App.js");
BundleTable.Bundles.Add(js);
}