本文整理汇总了C#中ScriptBundle类的典型用法代码示例。如果您正苦于以下问题:C# ScriptBundle类的具体用法?C# ScriptBundle怎么用?C# ScriptBundle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ScriptBundle类属于命名空间,在下文中一共展示了ScriptBundle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RegisterBundles
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.validate*"));
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/respond.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));
Bundle coffeeBundle = new ScriptBundle("~/bundles/coffee").Include(
"~/Scripts/CoffeeScripts/TestingCoffee.coffee");
coffeeBundle.Transforms.Insert(0,new CoffeeCompiler());
bundles.Add(coffeeBundle);
}
开发者ID:Nesk8er,项目名称:WebLife,代码行数:27,代码来源:BundleConfig.cs
示例2: RegisterBundles
public static void RegisterBundles(BundleCollection bundles)
{
var cssBundle = new StyleBundle("~/bundle/styles").IncludeDirectory("~/css/", "*.css");
bundles.Add(cssBundle);
var JQWidgetsBundle = new ScriptBundle("~/bundle/scripts/widgets").IncludeDirectory("~/scripts/JQwidgets/", "*.js");
bundles.Add(JQWidgetsBundle);
var VueComponents = new ScriptBundle("~/bundle/scripts/VUEComponents").IncludeDirectory("~/scripts/VUEComponents/", "*.js");
VueComponents.Transforms.Clear();
bundles.Add(VueComponents);
var VueComponents2 = new ScriptBundle("~/bundle/scripts/VUE_Components").IncludeDirectory("~/scripts/Vue_Components/", "*.js");
VueComponents2.Transforms.Clear();
bundles.Add(VueComponents2);
var jsCommon = new ScriptBundle("~/bundle/scripts/common");
jsCommon.Transforms.Clear();
jsCommon.Include(new string[]{
"~/scripts/common/moment.js",
"~/scripts/common/chart.js",
"~/scripts/common/materialize.js",
"~/scripts/common/velocity.js",
"~/scripts/common/vue.js",
"~/scripts/common/VueApp.js"
});
bundles.Add(jsCommon);
}
开发者ID:Tupbich,项目名称:CorporativeApp,代码行数:30,代码来源:BundleConfig.cs
示例3: RegisterBundles
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
var libs = new ScriptBundle("~/bundles/libs");
libs.Include(
"~/wwwroot/lib/jquery/dist/jquery.js",
"~/wwwroot/lib/lodash/lodash.js",
"~/wwwroot/lib/angular/angular.js",
"~/wwwroot/lib/angular-ui-router/release/angular-ui-router.js",
"~/wwwroot/lib/angular-bootstrap/ui-bootstrap-tpls.js",
"~/wwwroot/lib/angular-local-storage/dist/angular-local-storage.js"
);
var app = new ScriptBundle("~/bundles/app");
// Ensure the order is correct
app.Include(
"~/app/app.js",
"~/app/Router.js"
);
app.IncludeDirectory("~/app/", "*.js", true);
bundles.Add(libs);
bundles.Add(app);
}
开发者ID:LarsVonQualen,项目名称:Filmstrip,代码行数:27,代码来源:BundleConfig.cs
示例4: UserModelPkg
public UserModelPkg()
{
Name = PackageName;
ScriptBundle = new ScriptBundle("~/Scripts/Apps/shared/UserModel.min.js")
.Include("~/Scripts/Apps/UserModel/UserModel.js");
Category = Categories.Domain;
}
开发者ID:jhorback,项目名称:Harbor,代码行数:7,代码来源:UserModelPkg.cs
示例5: RegisterBundles
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/Bundles/js").Include(
"~/scripts/jquery-{version}.js",
"~/scripts/bootstrap.js"));
var appBundle = new ScriptBundle("~/Bundles/app").Include(
"~/scripts/angular.js",
"~/scripts/angular-animate.js",
"~/scripts/angular-messages.js",
"~/scripts/angular-resource.js",
"~/scripts/angular-route.js",
"~/scripts/angular-sanitize.js",
"~/scripts/angular-ui-router.js",
"~/scripts/angular-ui/ui-bootstrap.js",
"~/scripts/angular-ui/ui-bootstrap-tpls.js",
"~/Scripts/html5shiv.js",
"~/Scripts/respond.js",
"~/scripts/ngToast.min.js",
"~/scripts/ngToast.min.js");
appBundle.Include(System.Configuration.ConfigurationManager.AppSettings["UseTestData"] == "true"
? "~/scripts/settings-test.js"
: "~/scripts/settings-prod.js");
appBundle.IncludeDirectory("~/app", "*.js", true);
bundles.Add(appBundle);
bundles.Add(new StyleBundle("~/Bundles/css").Include(
"~/content/bootstrap.css",
"~/content/bootstrap2-icons.css",
"~/content/ngToast.min.css",
"~/content/Site.css"));
}
开发者ID:timothyfie,项目名称:EdmentumSample,代码行数:35,代码来源:BundleConfig.cs
示例6: BundleAndRenderScript
public static IHtmlString BundleAndRenderScript(this HtmlHelper helper, string path, params string[] urls)
{
var bundle = new ScriptBundle(path).Include(urls);
BundleTable.Bundles.Add(bundle);
return Scripts.Render(path);
}
开发者ID:KWondra625,项目名称:CSS-Images,代码行数:7,代码来源:HtmlHelperExtensions.cs
示例7: CreateScriptsBundles
static void CreateScriptsBundles(BundleCollection bundles)
{
var scripts = new ScriptBundle("~/resources/scripts")
.Include(
"~/Scripts/jquery-{version}.js",
"~/Scripts/jquery.validate.js",
"~/Scripts/jquery.validate.unobstrusive.js"
);
bundles.Add(scripts);
scripts = new ScriptBundle("~/resources/angular")
.Include(
"~/Scripts/angular.js",
"~/Scripts/angular-resource.js",
"~/Scripts/angular-sanitize.js",
"~/Scripts/i18n/angular-locale_de-de.js",
"~/Scripts/i18n/angular-locale_de.js",
"~/Scripts/jquery.signalR-1.*"
);
bundles.Add(scripts);
scripts = new ScriptBundleWithoutRename("~/resources/sessionvoting")
.Include(
"~/js/Transformations.js",
"~/js/VotingController.js",
"~/js/ResultController.js",
"~/js/SessionVotingServices.js",
"~/js/SessionVoting.js"
);
bundles.Add(scripts);
}
开发者ID:dotnet-koelnbonn,项目名称:SpeakerNet,代码行数:30,代码来源:InitializeBundles.cs
示例8: RegisterBundles
public static void RegisterBundles(BundleCollection Bundles)
{
// Enable optimizations that remove whitespace and size of files without compromising functionality
BundleTable.EnableOptimizations = true;
// Login and sign up bundles
ScriptBundle ScriptBundle = new ScriptBundle("~/bundles/js");
StyleBundle StyleBundle = new StyleBundle("~/bundles/css");
// Editor bundles for code editor in exercise view
ScriptBundle EditorScripts = new ScriptBundle("~/bundles/editorjs");
StyleBundle EditorStyles = new StyleBundle("~/bundles/editorcss");
ScriptBundle.IncludeDirectory("~/Scripts/", "*.js");
StyleBundle.IncludeDirectory("~/Content/", "*.css");
EditorScripts.IncludeDirectory("~/Scripts/Editor/", "*.js");
EditorStyles.IncludeDirectory("~/Content/Editor/", "*.css");
EditorStyles.IncludeDirectory("~/Content/Editor/Themes/", "*.css");
Bundles.Add(ScriptBundle);
Bundles.Add(StyleBundle);
Bundles.Add(EditorScripts);
Bundles.Add(EditorStyles);
}
开发者ID:rhinohq,项目名称:A2-Computing-Project,代码行数:26,代码来源:BundleConfig.cs
示例9: RegisterBundles
public static void RegisterBundles(BundleCollection bundles)
{
var frontpageAll = new ScriptBundle("~/bundles/js");
frontpageAll.Include("~/Scripts/lib/jquery-{version}.js")
.Include(
"~/Scripts/lib/jquery.ui.core.js",
"~/Scripts/lib/jquery.ui.widget.js",
"~/Scripts/lib/jquery.ui.position.js",
"~/Scripts/lib/jquery.ui.dialog.js",
"~/Scripts/lib/jquery.ui.mouse.js",
"~/Scripts/lib/jquery.ui.sortable.js",
"~/Scripts/handlebars.js")
.Include("~/Scripts/bootstrap.js")
.IncludeDirectory("~/Scripts/frontpage", "*.js");
var frontpage = new NontestBundle("~/bundles/frontpage", frontpageAll);
var frontpageTest = new TestBundle("~/bundles/frontpage-test", frontpageAll);
bundles.Add(frontpage);
bundles.Add(frontpageTest);
var southStreetTheme = new StyleBundle("~/Content/themes/south-street/all.css")
.IncludeDirectory("~/Content/themes/south-street/", "*.css")
.Include("~/Content/bootstrap.css");
bundles.Add(southStreetTheme);
}
开发者ID:fschwiet,项目名称:Gifenstein,代码行数:28,代码来源:BundleConfig.cs
示例10: RegisterBundles
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.validate*"));
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));
var reactBundle = new ScriptBundle("~/bundles/reactjs").Include(
"~/scripts/react/react.js",
"~/scripts/react/react-dom.js");
bundles.Add(reactBundle);
}
开发者ID:devsull,项目名称:GW2-Tools,代码行数:27,代码来源:BundleConfig.cs
示例11: BundlingPostStart
private static void BundlingPostStart()
{
var jQueryBundle = new ScriptBundle("~/Scripts/jquery")
.Include("~/Scripts/jquery-{version}.js");
BundleTable.Bundles.Add(jQueryBundle);
ScriptManager.ScriptResourceMapping.AddDefinition("jquery",
new ScriptResourceDefinition
{
Path = jQueryBundle.Path
});
var scriptBundle = new ScriptBundle("~/Scripts/all")
.Include("~/Scripts/jquery-{version}.js")
.Include("~/Scripts/jquery.validate.js")
.Include("~/Scripts/jquery.validate.unobtrusive.js")
.Include("~/Scripts/nugetgallery.js");
BundleTable.Bundles.Add(scriptBundle);
// Modernizr needs to be delivered at the top of the page but putting it in a bundle gets us a cache-buster.
// TODO: Use minified modernizr!
var modernizrBundle = new ScriptBundle("~/Scripts/modernizr")
.Include("~/Scripts/modernizr-{version}.js");
BundleTable.Bundles.Add(modernizrBundle);
var stylesBundle = new StyleBundle("~/Content/css")
.Include("~/Content/site.css");
BundleTable.Bundles.Add(stylesBundle);
}
开发者ID:kl4w,项目名称:NuGetGallery,代码行数:30,代码来源:AppActivator.cs
示例12: IncludeSharedScripts
private static void IncludeSharedScripts(ScriptBundle jsBundle)
{
jsBundle.Include("~/Assets/Scripts/shared/bootbox.js");
jsBundle.Include("~/Assets/Scripts/shared/head.js");
jsBundle.Include("~/Assets/Scripts/shared/tagmanager.js");
jsBundle.Include("~/Assets/Scripts/shared/toastr.js");
}
开发者ID:ByBox,项目名称:roadkill,代码行数:7,代码来源:Bundles.cs
示例13: GenerateBundleJS
private async static void GenerateBundleJS(ScriptBundle scriptBundle, BundleCollection bundles)
{
string bundleOutputPath = Path.Combine(HttpRuntime.AppDomainAppPath, BundleOutputFile);
BundleContext context = new BundleContext(new HttpContextWrapper(HttpContext.Current), bundles, ScriptsBundleVirtualPath);
System.Text.StringBuilder fileSpacer = new System.Text.StringBuilder();
try
{
using (StreamWriter outputStream = new StreamWriter(bundleOutputPath))
{
outputStream.BaseStream.Seek(0, SeekOrigin.End);
System.Collections.Generic.List<string> filePaths = PrepareFileList(scriptBundle.EnumerateFiles(context));
foreach (string filePath in filePaths)
{
string fileSpacerText = BuildFileSpacer(fileSpacer, filePath);
await outputStream.WriteAsync(fileSpacerText);
using (StreamReader jsFileStream = new StreamReader(filePath))
{
await outputStream.WriteAsync(await jsFileStream.ReadToEndAsync());
}
}
}
}
catch (System.NullReferenceException nullEx)
{
string error = nullEx.Message;
}
}
开发者ID:briandevlin,项目名称:mywebsite,代码行数:31,代码来源:BundleConfig.cs
示例14: AddAppBundles
private static void AddAppBundles(BundleCollection bundles)
{
var scriptBundle = new ScriptBundle(ScriptsBundleVirtualPath);
#if (DEBUG && LOCAL)
var adminAppDirFullPath = Path.Combine(HttpRuntime.AppDomainAppPath, AdminAppDir);
// Create the .NET bundle, then use that list to generate an actual bundle.js file
if (Directory.Exists(adminAppDirFullPath))
{
scriptBundle.Include(
// Order matters, so get the core app setup first
string.Format("~/{0}/app.core.module.js", AdminAppDir),
string.Format("~/{0}/app.module.js", AdminAppDir))
// then get any other top level js files
.IncludeDirectory(string.Format("~/{0}", AdminAppDir), "*.js", false)
// then get all nested module js files
.IncludeDirectory(string.Format("~/{0}", AdminAppDir), "*-module.js", true)
// finally, get all the other js files
.IncludeDirectory(string.Format("~/{0}", AdminAppDir), "*.js", true);
bundles.Add(scriptBundle);
// Generate a new bundle script. This should only be done on a local box as running from the build server causes issues.
GenerateBundleJS(scriptBundle, bundles);
}
#elif (DEBUG && !LOCAL)
scriptBundle.Include(string.Format("~/{0}/briandevlin.bundled.js", "scripts"));
bundles.Add(scriptBundle);
#elif !DEBUG
scriptBundle.Include(string.Format("~/{0}/briandevlin.bundled.js", "scripts"));
bundles.Add(scriptBundle);
#endif
}
开发者ID:briandevlin,项目名称:mywebsite,代码行数:33,代码来源:BundleConfig.cs
示例15: RegisterBundles
public static void RegisterBundles(BundleCollection bundles)
{
var application = new ScriptBundle("~/bundles/application-js")
.Include("~/Scripts/jquery-1.9.1.js")
.Include("~/Scripts/es5-shim.js")
.Include("~/Scripts/batman.js")
.Include("~/Scripts/batman.jquery.js")
.Include("~/Scripts/dashing.coffee")
.Include("~/Scripts/gridster/jquery.leanModal.min.js")
.Include("~/Scripts/jquery.knob.js")
.Include("~/Scripts/d3.v2.min.js")
.Include("~/Scripts/rickshaw.min.js")
.Include("~/Scripts/gridster/jquery.gridster.js")
.Include("~/Scripts/dashing.gridster.coffee")
.IncludeDirectory("~/Widgets", "*.coffee", true)
.Include("~/Scripts/application.coffee");
application.Transforms.Add(new CoffeeTransform());
bundles.Add(application);
var styles = new Bundle("~/bundles/application-css")
.Include("~/Assets/stylesheets/font-awesome.css")
.Include("~/Assets/stylesheets/jquery.gridster.css")
.IncludeDirectory("~/Widgets", "*.scss", true)
.Include("~/Assets/stylesheets/application.scss");
styles.Transforms.Add(new ScssTransform());
bundles.Add(styles);
BundleTable.EnableOptimizations = true;
}
开发者ID:KalyanArangam,项目名称:dashing.net,代码行数:31,代码来源:BundleConfig.cs
示例16: RegisterBundles
public static void RegisterBundles(BundleCollection bundles)
{
BundleTable.EnableOptimizations = true;
Console.WriteLine("Registering SucroseBundle");
var coreBundle = new ScriptBundle("~/Bundles/sucrose");
var tsBundle = new Bundle("~/Bundles/typescript", new WrapperTransform());
try
{
coreBundle.IncludeDirectory("~/Scripts/Sucrose", "*.js");
}
catch (ArgumentException)
{
}
try
{
tsBundle.IncludeDirectory("~/TypeScript", "*.ts");
}
catch (ArgumentException)
{
}
bundles.Add(coreBundle);
bundles.Add(tsBundle);
}
开发者ID:adamabdelhamed,项目名称:Sucrose,代码行数:26,代码来源:SucroseBundle.cs
示例17: RegisterBundles
public static void RegisterBundles(BundleCollection bundles)
{
bundles.UseCdn = true;
bundles.IgnoreList.Ignore("*.intellisense.js", OptimizationMode.Always);
bundles.IgnoreList.Ignore("*.min.css", OptimizationMode.Always);
bundles.IgnoreList.Ignore("*.map", OptimizationMode.Always);
string cdnPath = new UriBuilder(CloudConfigurationManager.GetSetting("CdnStorageCdnUrl")).Host;
bundles.Add(new StyleBundle("~/bundles/css/main")
.Include("~/bower_components/bootstrap/dist/css/bootstrap.css")
.Include("~/build/assets/stylesheets/site.css"));
bundles.Add(new ScriptBundle("~/bundles/app").IncludeDirectory("~/Scripts/app", "*.js", true));
var jqueryBundle = new ScriptBundle("~/bundles/jquery", "https://" + cdnPath + "/scripts/jquery/3.1.0/jquery.min.js")
.Include("~/bower_components/jquery/dist/jquery.js");
jqueryBundle.CdnFallbackExpression = "jQuery";
bundles.Add(jqueryBundle);
var bootstrapBundle = new ScriptBundle("~/bundles/bootstrap", "https://" + cdnPath + "/scripts/bootstrap/3.3.7/bootstrap.min.js")
.Include("~/bower_components/bootstrap/dist/js/bootstrap.js");
bootstrapBundle.CdnFallbackExpression = "window.jQuery && window.jQuery.fn && window.jQuery.fn.modal";
bundles.Add(bootstrapBundle);
}
开发者ID:chlela,项目名称:gshahine.com,代码行数:26,代码来源:BundleConfig.cs
示例18: RegisterAngularModule
private static void RegisterAngularModule(this BundleCollection bundles, string bundleName, string moduleName, string cdn, string local)
{
var angularBundle = new ScriptBundle($"~/bundles/{bundleName}", cdn).Include(local);
angularBundle.CdnFallbackExpression = $"(function() {{ try {{ window.angular.module('{moduleName}'); }} catch (e) {{ return false; }} return true; }})()";
bundles.Add(angularBundle);
}
开发者ID:trichards57,项目名称:new-bike-tracker,代码行数:7,代码来源:BundleConfig.cs
示例19: RegisterBundles
public static void RegisterBundles(BundleCollection bundles)
{
var cssTransformer = new CssTransformer();
var jsTransformer = new JsTransformer();
var nullOrderer = new NullOrderer();
var js = new ScriptBundle("~/bundles/js").Include(
"~/Scripts/jquery-{version}.js",
"~/Scripts/bootstrap.js",
"~/Scripts/less.min.js",
"~/Scripts/moment.js",
"~/Scripts/main.js",
"~/Scripts/jquery.quick.pagination.min.js",
"~/Scripts/bootstrap-fileupload.min.js"
);
js.Transforms.Add(jsTransformer);
js.Orderer = nullOrderer;
bundles.Add(js);
var css = new StyleBundle("~/bundles/css").Include(
"~/Content/less/bootstrap.less",
"~/Content/styles.css",
"~/Content/custom.css",
"~/Content/bootstrap-fileupload.min.css"
);
css.Transforms.Add(cssTransformer);
css.Orderer = nullOrderer;
bundles.Add(css);
}
开发者ID:jchindev,项目名称:testing1,代码行数:32,代码来源:BundleConfig.cs
示例20: RegisterBundles
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.IgnoreList.Clear();
bundles.IgnoreList.Ignore("*.intellisense.js");
bundles.IgnoreList.Ignore("*-vsdoc.js");
bundles.IgnoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);
bundles.IgnoreList.Ignore("*.min.css", OptimizationMode.WhenDisabled);
var scripts = new ScriptBundle("~/bundles/scripts")
.Include("~/Scripts/jquery-{version}.js")
.Include("~/Scripts/bootstrap.js")
.Include("~/Scripts/knockout-{version}.js")
.Include("~/Scripts/knockout.mapping-latest.js")
.Include("~/Scripts/sugar.min.js")
.Include("~/Scripts/accounting.min.js")
.Include("~/Scripts/linq.min.js")
.Include("~/Scripts/moment.min.js")
.Include("~/Scripts/Common/customBindings.js")
.Include("~/Scripts/stickyTableHeader.js");
bundles.Add(scripts);
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css",
"~/Content/upcoming-races.css",
"~/Content/current-race.css",
"~/Content/race-results.css",
"~/Content/standings.css"));
// Set EnableOptimizations to false for debugging. For more information,
// visit http://go.microsoft.com/fwlink/?LinkId=301862
BundleTable.EnableOptimizations = true;
}
开发者ID:matt-bartling,项目名称:pinewood-derby-manager,代码行数:35,代码来源:BundleConfig.cs
注:本文中的ScriptBundle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论