当前位置: 首页>>代码示例>>C#>>正文


C# StyleBundle类代码示例

本文整理汇总了C#中StyleBundle的典型用法代码示例。如果您正苦于以下问题:C# StyleBundle类的具体用法?C# StyleBundle怎么用?C# StyleBundle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StyleBundle类属于命名空间,在下文中一共展示了StyleBundle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RegisterBundles

        // Дополнительные сведения об объединении см. по адресу: http://go.microsoft.com/fwlink/?LinkId=301862
        public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.Add(new ScriptBundle("~/bundles/js-basic").Include(
                        "~/Scripts/vendor/jquery-{version}.js",
                        "~/Scripts/vendor/bootstrap.js",
                        "~/Scripts/vendor/respond.js"));

            bundles.Add(new ScriptBundle("~/bundles/js-vocabulary").Include(
                "~/Scripts/vendor/ember/ember.min.js",
                "~/Scripts/vendor/ember/ember-data.min.js",
                "~/Scripts/vendor/bootstrap-modal-popover.js",
                "~/Scripts/vendor/bootstrap-dialog.min.js",
                "~/Scripts/vendor/jquery.scrollTo.min.js",
                "~/Scripts/vendor/jquery.cookie.js",
                "~/Scripts/app-vocabulary/app/vocabulary-templates.js",
                "~/Scripts/app-vocabulary/app/vocabulary.js"));

            bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                        "~/Scripts/vendor/jquery.validate*"));

            // Используйте версию Modernizr для разработчиков, чтобы учиться работать. Когда вы будете готовы перейти к работе,
            // используйте средство построения на сайте http://modernizr.com, чтобы выбрать только нужные тесты.
            bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                        "~/Scripts/vendor/modernizr-*"));

            var basicStylesBundle = new StyleBundle("~/Content/css").Include(
                      "~/Content/bootstrap.css",
                      "~/Content/site.css");
            basicStylesBundle.Transforms.Add(new CssMinify());
            bundles.Add(basicStylesBundle);
        }
开发者ID:wsbaser,项目名称:CoolVocabulary,代码行数:32,代码来源:BundleConfig.cs

示例2: 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 ScriptBundle("~/bundles/app").Include(
                        "~/Scripts/app/*.js"));
            bundles.Add(new ScriptBundle("~/bundles/frameworks").Include(
                        "~/Scripts/frameworks/*.js"));

            var cssbundle = new StyleBundle("~/Content/css");
            cssbundle.Include(
                      "~/Content/bootstrap.css",
                      "~/Content/site.css",
                      "~/Content/less/*.less");
            cssbundle.Transforms.Add(new LessTransform());

            bundles.Add(cssbundle);

            BundleTable.EnableOptimizations = true;
        }
开发者ID:okusnadi,项目名称:Asp.Net-MVC-5-Bootstrap-Application,代码行数:34,代码来源:BundleConfig.cs

示例3: RegisterBundles

		// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
		public static void RegisterBundles(BundleCollection bundles)
		{
			//NOTE:
			//Be sure to add "<add name="BundleModule" type="System.Web.Optimization.BundleModule" />" to <modules> in <system.webServer>			
			
			/***********************************************CSS*********************************************/
			/*
			bundles.Add(new StyleBundle("~/Content/css/site_css")
							.Include("~/Content/css/site.css")
			);
			bundles.Add(new StyleBundle("~/Content/css/bootstrap_css")
							.Include("~/Content/css/bootstrap.css")
							.Include("~/Content/css/bootstrap-responsive.css")
			);
			*/

			bundles.UseCdn = true;

			/*CORE*/
            var SiteCSSBundle = new StyleBundle("~/Content/themes/app-name/styles/styles_css").Include(
				"~/Content/themes/app-name/styles/styles.css");
			SiteCSSBundle.Orderer = new PassthruBundleOrderer();
			bundles.Add(SiteCSSBundle);

			/***********************************************JS*********************************************/
			/*SITE*/
			var SiteJSBundle = new ScriptBundle("~/Scripts/site_js").Include(
				"~/Scripts/site.js");
			SiteJSBundle.Orderer = new PassthruBundleOrderer();
			bundles.Add(SiteJSBundle);

			/*JQUERY*/
			var JQueryBundle = new ScriptBundle("~/Scripts/jquery_js", "//code.jquery.com/jquery-1.10.2.min.js").Include(
					"~/Scripts/jquery-1.10.2.min.js");
			JQueryBundle.CdnFallbackExpression = "window.jQuery";
			bundles.Add(JQueryBundle);

			/*ANGULAR*/
			var AngularBundle = new ScriptBundle("~/Scripts/angular_js").Include(
				"~/Scripts/angular.min.js",
				"~/app/app.js",
				"~/app/filters.js",
				"~/app/services.js",
				"~/app/controllers.js",
				"~/app/directives.js");
			AngularBundle.CdnFallbackExpression = "window.angular";

			var AngularRouteBundle = new ScriptBundle("~/Scripts/angularRoute_js").Include("~/Scripts/angular-route.min.js");
			AngularRouteBundle.CdnFallbackExpression = "window.angular.module('ngRoute')";

			var AngularSanitizeBundle = new ScriptBundle("~/Scripts/angularSanitize_js").Include("~/Scripts/angular-sanitize.min.js");
			AngularSanitizeBundle.CdnFallbackExpression = "window.angular.module('ngSanitize')";

			bundles.Add(AngularBundle);
			bundles.Add(AngularRouteBundle);
			bundles.Add(AngularSanitizeBundle);

			/**********************************************************************************************/
			BundleTable.EnableOptimizations = true; //enable bundling/minification/bundle-caching
		}
开发者ID:dbvibe,项目名称:MVC-Template,代码行数:61,代码来源:BundleConfig.cs

示例4: 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

示例5: RegisterBundles

        public static void RegisterBundles(BundleCollection bundles)
        {
            var orderer= new AsIsBundleOrderer();

            StyleBundle bootstrapBundle = new StyleBundle("~/Templates/Template1/Bootstrap");
            bootstrapBundle.Orderer = orderer;
            bootstrapBundle.Include(
                "~/Templates/Template1/css/bootstrap.css",
                "~/Templates/Template1/css/bootstrap-responsive.css",
                "~/Templates/Template1/css/font-awesome.css",
                "~/Templates/Template1/css/bootstrap-responsive.min.css");
            bundles.Add(bootstrapBundle);

            var jqueryBundle=new ScriptBundle("~/Templates/Template1/Jquery").Include(
                 "~/Templates/Template1/js/vendor/modernizr-2.6.2.min.js",
                "~/Templates/Template1/js/vendor/jquery-1.9.1.min.js",
                "~/Templates/Template1/js/jquery-ui-1.10.3.custom.min.js"
                ).ForceOrdered();
            //jqueryBundle.Orderer= orderer;
            bundles.Add(jqueryBundle);

            //bundles.FileSetOrderList.Clear();
            //BundleFileSetOrdering orderList = new BundleFileSetOrdering("modernizr");
            //orderList.Files.Add("~/Templates/Template1/css/bootstrap.css");
            //orderList.Files.Add("~/Templates/Template1/css/bootstrap-responsive.css");
            //orderList.Files.Add("~/Templates/Template1/css/font-awesome.css");
            //orderList.Files.Add("~/Templates/Template1/css/bootstrap-responsive.min.css");

            //orderList.Files.Add("~/Templates/Template1/js/vendor/modernizr-2.6.2.min.js");
            //orderList.Files.Add("~/Templates/Template1/js/vendor/jquery-1.9.1.min.js");
            //orderList.Files.Add("~/Templates/Template1/js/jquery-ui-1.10.3.custom.min.js");
            //bundles.FileSetOrderList.Add(orderList);
        }
开发者ID:prasanjeetd,项目名称:myshop,代码行数:33,代码来源:BundleConfig.cs

示例6: AddStyleBundles

        private static void AddStyleBundles(BundleCollection bundles)
        {
            var appStyle = new StyleBundle("~/Content/app")
                .Include("~/Content/app/MainStyle.css");

            bundles.Add(appStyle);
        }
开发者ID:KyorCode,项目名称:Bootcamp2013,代码行数:7,代码来源:RegisterBundles.cs

示例7: StandardStyleBundle

 public StandardStyleBundle(string basePath)
 {
     _styleBundle = new StyleBundle(basePath + BundlePath);
     _styleBundle.Orderer = new AsIsBundleOrderer();
     _styleBundle.Builder = new CustomStyleBuilder();
     _styleBundle.Transforms.Clear();
 }
开发者ID:4-Roads,项目名称:FourRoads.TelligentCommunity,代码行数:7,代码来源:StandardStyleBundle.cs

示例8: 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"));

            // 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"));

            bundles.Add(new ScriptBundle("~/bundles/angular").Include(
                "~/Scripts/angular.js",
                "~/Scripts/angular-ui-router.js"));

            bundles.Add(new ScriptBundle("~/bundles/core").IncludeDirectory("~/app/", "*.js", true));

            var css = new StyleBundle("~/app/css").IncludeDirectory("~/app/", "*.css", true);

            css.Transforms.Add(new CssMinify());
            bundles.Add(css);
            bundles.IgnoreList.Clear();
        }
开发者ID:mattsw,项目名称:Shield,代码行数:31,代码来源:BundleConfig.cs

示例9: Register

        public static void Register(IKernel kernel)
        {
            if (!CurrentRequestData.DatabaseIsInstalled)
                return;

            foreach (IStylesheetBundle bundle in kernel.GetAll<IStylesheetBundle>())
            {
                var styleBundle = new StyleBundle(bundle.Url);
                foreach (string file in bundle.Files)
                {
                    styleBundle.Include(file);
                }
                BundleTable.Bundles.Add(styleBundle);
            }
            foreach (IScriptBundle bundle in kernel.GetAll<IScriptBundle>())
            {
                var styleBundle = new ScriptBundle(bundle.Url);
                foreach (string file in bundle.Files)
                {
                    styleBundle.Include(file);
                }
                BundleTable.Bundles.Add(styleBundle);
            }
            BundleTable.EnableOptimizations = kernel.Get<BundlingSettings>().EnableOptimisations;
        }
开发者ID:neozhu,项目名称:MrCMS,代码行数:25,代码来源:BundleRegistration.cs

示例10: RegisterBundles

        public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/jquery-1.*"));

            bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
                        "~/Scripts/jquery-ui*"));

            bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                        "~/Scripts/jquery.unobtrusive*",
                        "~/Scripts/jquery.validate*"));

            bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                        "~/Scripts/modernizr-*"));

            var css = new StyleBundle("~/Content/css").Include(
                "~/Content/site.less");
            css.Transforms.Add(new LessMinify());
            bundles.Add(css);

            bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
                        "~/Content/themes/base/jquery.ui.core.css",
                        "~/Content/themes/base/jquery.ui.resizable.css",
                        "~/Content/themes/base/jquery.ui.selectable.css",
                        "~/Content/themes/base/jquery.ui.accordion.css",
                        "~/Content/themes/base/jquery.ui.autocomplete.css",
                        "~/Content/themes/base/jquery.ui.button.css",
                        "~/Content/themes/base/jquery.ui.dialog.css",
                        "~/Content/themes/base/jquery.ui.slider.css",
                        "~/Content/themes/base/jquery.ui.tabs.css",
                        "~/Content/themes/base/jquery.ui.datepicker.css",
                        "~/Content/themes/base/jquery.ui.progressbar.css",
                        "~/Content/themes/base/jquery.ui.theme.css"));
        }
开发者ID:panchaldineshb,项目名称:GitHubRepository,代码行数:34,代码来源:BundleConfig.cs

示例11: RegisterBundles

        public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.UseCdn = true;

            var jqueryCdnPath = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js";

            bundles.Add(new ScriptBundle(Links.bundles.scripts.jquery, jqueryCdnPath) { CdnFallbackExpression = "window.jquery" }.
                Include("~/Scripts/jquery-{version}.js"));

            // Libraries
            var libraryBundle = new ScriptBundle(Links.bundles.scripts.common);
            libraryBundle.Include("~/Scripts/modernizr-2.6.2.js");
            libraryBundle.Include("~/Scripts/bootstrap.js");
            libraryBundle.Include("~/Scripts/knockout-2.2.0.debug.js");
            libraryBundle.Include("~/Scripts/jquery.validate.js");
            libraryBundle.Include("~/Scripts/jquery.validate.unobtrusive.js");
            libraryBundle.Include("~/Scripts/jquery.unobtrusive-ajax.js");
            bundles.Add(libraryBundle);

            // CSS
            var cssBundle = new StyleBundle(Links.bundles.styles.common);
            cssBundle.Include("~/Content/Styles/bootstrap.css");
            cssBundle.Include("~/Content/Styles/bootstrap-responsive.css");
            cssBundle.Include("~/Content/Styles/main.css");
            bundles.Add(cssBundle);

            // Enable bundling
            BundleTable.EnableOptimizations = true;
        }
开发者ID:eddielee6,项目名称:FirstIssue,代码行数:29,代码来源:BundleConfig.cs

示例12: 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:projectkudu,项目名称:NuGetGallery,代码行数:30,代码来源:AppActivator.cs

示例13: 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

示例14: InitializeReports

        private static void InitializeReports()
        {
            var logger = ObjectFactory.GetInstance<Logger>();
            logger.Trace("[Initialization].[Bundling].[Bootstrapper].[InitializeReports] invoked.");

            var path = BundleExtensions.GetScriptBundlePath(Content.Views.Reports.Index_aspx);
            var bundle = new ScriptBundle(path)
                .Include(managementScriptPaths)
                .Include(new []
                {
                    Content.Scripts.Reports.Index_js
                });
            BundleTable.Bundles.Add(bundle);

            path = BundleExtensions.GetStyleBundlePath(Content.Views.Reports.Index_aspx);
            bundle = new StyleBundle(path)
                .Include(managementStylePaths)
                .Include(new []
                {
                    Content.Styles.Reports.Index_css
                });
            BundleTable.Bundles.Add(bundle);

            logger.Debug("[Initialization].[Bundling].[Bootstrapper].[InitializeReports] finished work.");
        }
开发者ID:vitalyobukhov,项目名称:SmsToMail,代码行数:25,代码来源:Reports.cs

示例15: 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*"));

            bundles.Add(new ScriptBundle("~/bundles/angular-core").Include(
                "~/Scripts/angular.js",
                "~/Scripts/angular-resource.js"
                ));

            bundles.Add(new ScriptBundle("~/bundles/angular-app").IncludeDirectory("~/app","*.js"));

            bundles.Add(new ScriptBundle("~/bundles/less-js").Include("~/Scripts/less-1.5.1.js"));

            // 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"));

            var lessBundle = new StyleBundle("~/Content/css");
            lessBundle.Include("~/less/bootstrap/bootstrap.less");
            lessBundle.Include("~/less/font-awesome/font-awesome.less");
            lessBundle.Include("~/content/site.less");

            bundles.Add(lessBundle);
        }
开发者ID:rodmjay,项目名称:Ideal,代码行数:34,代码来源:BundleConfig.cs


注:本文中的StyleBundle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。