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


C# StyleBundle.IncludeDirectory方法代码示例

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


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

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

示例2: RegisterBundles

        // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
        public static void RegisterBundles(BundleCollection bundles)
        {
            SetupIgnorePatterns(bundles.IgnoreList);

            bundles.Add(new StyleBundle("~/Content/kendoui/css")
                .Include("~/Content/KendoUI/kendo.common.min.css","~/Content/KendoUI/kendo.default.min.css"));

            Bundle bootstrapBundle = new StyleBundle("~/Content/bootstrap/css/styles");
            bootstrapBundle.Include("~/Content/bootstrap/css/bootstrap.css", "~/Content/bootstrap/css/bootstrap-responsive.css");
            bundles.Add(bootstrapBundle);

            Bundle flattyBundle = new StyleBundle("~/Content/flatty/stylesheets/styles");
            flattyBundle.Include("~/Content/flatty/stylesheets/dark-theme.css", "~/Content/flatty/stylesheets/theme-colors.css", "~/Content/flatty/stylesheets/plugins/tabdrop/tabdrop.css");
            bundles.Add(flattyBundle);

            Bundle cssBundle = new StyleBundle("~/Content/css/styles");
            cssBundle.IncludeDirectory("~/Content/css", "*.css");
            cssBundle.IncludeDirectory("~/Content", "*.css");
            bundles.Add(cssBundle);

            Bundle lessBundle = new Bundle("~/Content/less", new LessMinify());
            lessBundle.Include("~/Content/Site.less");
            bundles.Add(lessBundle);

            Bundle scriptBundle = new ScriptBundle("~/bundles/scripts");
            scriptBundle.Include("~/Scripts/jquery-{version}.js");
            scriptBundle.Include("~/Scripts/knockout-{version}.js");
            scriptBundle.Include("~/Scripts/knockout.mapping-latest.js");
            scriptBundle.Include("~/Scripts/knockout.validation.js");
            scriptBundle.Include("~/Scripts/kendo.web.min.js");
            scriptBundle.Include("~/Scripts/knockout-kendo.min.js");
            scriptBundle.Include("~/Scripts/jquery.history.js");
            scriptBundle.Include("~/Scripts/moment.js");
            scriptBundle.Include("~/Scripts/signals.min.js");
            scriptBundle.Include("~/Scripts/crossroads.min.js");
            scriptBundle.Include("~/Content/bootstrap/js/bootstrap.js");
            scriptBundle.Include("~/Scripts/select2.js");
            scriptBundle.Include("~/Content/flatty/javascripts/plugins/mobile_events/jquery.mobile-events.min.js");
            scriptBundle.Include("~/Content/flatty/javascripts/jquery/jquery-migrate.min.js");
            scriptBundle.Include("~/Content/flatty/javascripts/nav.js");
            scriptBundle.Include("~/Content/flatty/javascripts/plugins/tabdrop/bootstrap-tabdrop.js");
            scriptBundle.Include("~/Scripts/toastr.js");
            scriptBundle.IncludeDirectory("~/App/Global", "*.js", true);
            scriptBundle.IncludeDirectory("~/App", "*.js", true);
            bundles.Add(scriptBundle);

            // Uncomment to see release configuration bundling.
            //BundleTable.EnableOptimizations = true;
        }
开发者ID:tomsean,项目名称:EventSourcingTodo,代码行数:50,代码来源:BundleConfig.cs

示例3: Application_Start

        protected void Application_Start(object sender, EventArgs e)
        {
            var cssBundle = new StyleBundle("~/default/css");

            BundleTable.EnableOptimizations = true;

            cssBundle.IncludeDirectory("~/content/", "*.css", true);

            BundleTable.Bundles.Add(cssBundle);
        }
开发者ID:thiagosartor,项目名称:Diario,代码行数:10,代码来源:Global.asax.cs

示例4: RegisterBundles

        // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
        public static void RegisterBundles(BundleCollection bundles)
        {
            var styles = new StyleBundle("~/Content/css");
            styles.IncludeDirectory("~/Content/", "*.css", true);
            bundles.Add(styles);

            var scripts = new ScriptBundle("~/Scripts");
            scripts.IncludeDirectory("~/Scripts/", "*.js", true);
            bundles.Add(scripts);
        }
开发者ID:danabenson,项目名称:BucketList,代码行数:11,代码来源:BundleConfig.cs

示例5: Application_Start

        protected void Application_Start(object sender, EventArgs e)
        {
            var cssBundle = new StyleBundle("~/css");
            cssBundle.IncludeDirectory("~/content/css", "*.css");

            // Create the JS bundle
            var jsBundle = new ScriptBundle("~/js");
            jsBundle.IncludeDirectory("~/content/js", "*.js");

            BundleTable.Bundles.Add(cssBundle);
            BundleTable.Bundles.Add(jsBundle);
        }
开发者ID:kwilson,项目名称:BundlingInDotNet4-SampleCode,代码行数:12,代码来源:Global.asax.cs

示例6: RegisterBundles

        public static void RegisterBundles(BundleCollection bundles)
        {
            var myBundle = new StyleBundle("~/bundles/css");
            myBundle.IncludeDirectory("~/Content/", "OnlinePhotoManager.css");

            bundles.Add(myBundle);

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

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

            bundles.Add(new StyleBundle("~/bundles/jqueryCssLibs").Include(
                        "~/Content/jquery*"));

            bundles.Add(new ScriptBundle("~/bundles/jqueryForms").Include(
                        "~/Scripts/jquery.form.js"));

            bundles.Add(new ScriptBundle("~/bundles/lightbox").Include(
                        "~/Scripts/lightbox.js"));

            bundles.Add(new StyleBundle("~/bundles/lightboxcss").Include(
                        "~/Content/lightbox.css"));

            bundles.Add(new ScriptBundle("~/bundles/asyncCalls").Include(
                       "~/Scripts/asyncCalls.js"));

            bundles.Add(new ScriptBundle("~/bundles/highlight").Include(
                       "~/Scripts/jquery.highlight-4.js"));

            bundles.Add(new ScriptBundle("~/bundles/search").Include(
                       "~/Scripts/search.js"));

            bundles.Add(new ScriptBundle("~/bundles/datepicker").Include(
                       "~/Scripts/jquery.ui.datepicker.js"));

            bundles.Add(new ScriptBundle("~/bundles/opinion").Include(
                       "~/Scripts/opinion.js"));
        }
开发者ID:nzhuravel,项目名称:PhotoManager,代码行数:41,代码来源:BundleConfig.cs

示例7: Configure

        private static void Configure(BundleCollection bundles)
        {
            // libraries
            bundles.Add(
                new ScriptBundle("~/bundles/script-lib")
                    .Include("~/Scripts/moment-with-langs.js",
                             "~/Scripts/linq.js",
                             "~/Scripts/angular.js",
                             "~/Scripts/angular-locale-nl_NL.js",
                             "~/Scripts/angular-resource.js",
                             "~/Scripts/angular-route.js",
                             "~/Scripts/angular-progress.js",
                             "~/Scripts/angular-ui/ui-bootstrap-tpls.js",
                             "~/Scripts/hotkeys.js",
                             "~/Scripts/angular-ng-google-chart.js"
                             ));

            bundles.Add(
                new StyleBundle("~/bundles/style-lib")
                    .Include("~/Content/animate.css")
                    .Include("~/Content/bootstrap.css")
                    .Include("~/Content/angular-progress.css"));

            // own
            ScriptBundle appScriptBundle =
                new ScriptBundle("~/bundles/script-app");
            appScriptBundle.IncludeDirectory("~/Scripts/App", "*.js", true);
            appScriptBundle.Transforms.Add(new JsMinify());

            bundles.Add(appScriptBundle);

            StyleBundle appStyleBundle = new StyleBundle("~/bundles/style-app");
            appStyleBundle.IncludeDirectory("~/Content/App", "*.css");
            appStyleBundle.Transforms.Add(new CssMinify());

            bundles.Add(appStyleBundle);
        }
开发者ID:Jaspervandijk,项目名称:financial-app,代码行数:37,代码来源:BundleConfig.cs

示例8: CreateBundles

 /// <summary>
 /// Auto creates the bundles for the given directory
 /// </summary>
 /// <param name="Directory">Directory to create bundles from</param>
 private void CreateBundles(IDirectory Directory)
 {
     if (!Directory.Exists)
         return;
     string BundleDirectory = Directory.FullName.Replace(FileManager.Directory("~/").FullName, "~/").Replace("\\", "/");
     StyleBundle Bundle = new StyleBundle(BundleDirectory + "/bundle/css");
     Bundle.Transforms.Clear();
     Bundle.Transforms.Add(new Transformer());
     if (Directory.Exists)
     {
         foreach (string Value in FileTypes[AssetType.CSS])
         {
             Bundle.IncludeDirectory(BundleDirectory, "*." + Value, true);
         }
     }
     ScriptBundle Bundle2 = new ScriptBundle(BundleDirectory + "/bundle/js");
     Bundle2.Transforms.Clear();
     Bundle2.Transforms.Add(new Transformer());
     if (Directory.Exists)
     {
         foreach (string Value in FileTypes[AssetType.Javascript])
         {
             Bundle2.IncludeDirectory(BundleDirectory, "*." + Value, true);
         }
     }
     BundleTable.Bundles.Add(Bundle);
     BundleTable.Bundles.Add(Bundle2);
     foreach (IDirectory SubDirectory in Directory.EnumerateDirectories("*", SearchOption.TopDirectoryOnly))
     {
         CreateBundles(SubDirectory);
     }
 }
开发者ID:modulexcite,项目名称:Batman,代码行数:36,代码来源:AssetManager.cs

示例9: RegisterBundles

        public static void RegisterBundles(BundleCollection bundles)
        {
            // bundles.IgnoreList.Clear();
            //  AddDefaultIgnorePatterns(bundles.IgnoreList);
            //NOTE: it's bundles.DirectoryFilter in Microsoft.AspNet.Web.Optimization.1.1.3 and not bundles.IgnoreList

            var engine = new V8JsEngine();

            var uglySettings = new UglifySettings();

            uglySettings.Js.CodeGeneration.Beautify = true;

            bundles.UseCdn = false;

            var uglifyJsMinifier = new UglifyJsMinifier(() => engine, uglySettings)

            {
                CompressionOptions = { Angular = true },
                ParsingOptions = new ParsingOptions { Strict = true },
                CodeGenerationOptions = new CodeGenerationOptions()
            };

            var lessTranslator = new LessTranslator();

            var cssTransformer = new CssTransformer(new CleanCssMinifier(), new ITranslator[] { lessTranslator });

            var tsTranslater = new TypeScriptTranslator();

            var jsTransformer = new JsTransformer(uglifyJsMinifier, new List<ITranslator> { tsTranslater });

            var jsBundle = new CustomScriptBundle("~/bundles/js");

            jsBundle.IncludeDirectory("~/scripts", "*.js", true);
            jsBundle.IncludeDirectory("~/scripts", "*.map", true);

            bundles.IgnoreList.Ignore("angular-mocks.js");
            bundles.IgnoreList.Ignore("angular-scenario.js");

             //   jsBundle.IncludeDirectory("~/scripts/angular-dialog-service-5.1.2", "*.js", true);

            jsBundle.Builder = new DefaultBundleBuilder();

            jsBundle.Orderer = new JsBundlerOrderer();

            jsBundle.Transforms.Add(jsTransformer);

            bundles.Add(jsBundle);

            var typeScriptBundle = new CustomScriptBundle("~/bundles/ts");    //// Typescript generatred locally via visual studio and checked in - not done on the fly

            typeScriptBundle.IncludeDirectory("~/app", "*.js", true);

            typeScriptBundle.Transforms.Add(jsTransformer);

            typeScriptBundle.Builder = new DefaultBundleBuilder();

            typeScriptBundle.Orderer = new JsBundlerOrderer();

            bundles.Add(typeScriptBundle);

            var lessCssBundle = new Bundle("~/bundles/less");

            lessCssBundle.Include("~/Content/bootstrap/bootstrap.less");

            lessCssBundle.Builder = new DefaultBundleBuilder();

            lessCssBundle.Transforms.Add(cssTransformer);

            lessCssBundle.Orderer = new DefaultBundleOrderer();

            bundles.Add(lessCssBundle);

            var cssBundle = new StyleBundle("~/bundles/css");

            cssBundle.IncludeDirectory("~/Content/Bootstrap", "*.css", false);
            cssBundle.IncludeDirectory("~/Content/", "*.css", false);
            cssBundle.IncludeDirectory("~/Content/css", "*.css", false);

            cssBundle.Builder = new DefaultBundleBuilder();

            cssBundle.Transforms.Add(cssTransformer);

            cssBundle.Orderer = new PushToTopOrderer("bootstrap");

            bundles.Add(cssBundle);

            var publicCssBundle = new StyleBundle("~/bundles/public/css");
            publicCssBundle.IncludeDirectory("~/Content/public", "*.css", true);
            publicCssBundle.Builder = new DefaultBundleBuilder();
            publicCssBundle.Transforms.Add(cssTransformer);
            publicCssBundle.Orderer = new PushToTopOrderer("bootstrap");
            bundles.Add(publicCssBundle);
        }
开发者ID:brucewu16899,项目名称:lacjam,代码行数:93,代码来源:BundleConfig.cs

示例10: CreateBundles

 /// <summary>
 /// Auto creates the bundles for the given directory
 /// </summary>
 /// <param name="Directory">Directory to create bundles from</param>
 private void CreateBundles(DirectoryInfo Directory)
 {
     if (Directory == null || !Directory.Exists || string.IsNullOrEmpty(Directory.FullName))
         return;
     var BundleDirectory = Directory.FullName.Replace(new DirectoryInfo("~/").FullName, "~/").Replace("\\", "/");
     var Bundle = new StyleBundle(BundleDirectory + "/bundle/css");
     Bundle.Transforms.Clear();
     Bundle.Transforms.Add(new Transformer(this));
     if (Directory.Exists)
     {
         foreach (string Value in FileTypes[AssetType.CSS])
         {
             Bundle.IncludeDirectory(BundleDirectory, "*." + Value, true);
         }
     }
     var Bundle2 = new ScriptBundle(BundleDirectory + "/bundle/js");
     Bundle2.Transforms.Clear();
     Bundle2.Transforms.Add(new Transformer(this));
     if (Directory.Exists)
     {
         foreach (string Value in FileTypes[AssetType.Javascript])
         {
             Bundle2.IncludeDirectory(BundleDirectory, "*." + Value, true);
         }
     }
     BundleTable.Bundles.Add(Bundle);
     BundleTable.Bundles.Add(Bundle2);
     foreach (DirectoryInfo SubDirectory in Directory.EnumerateDirectories("*", System.IO.SearchOption.TopDirectoryOnly))
     {
         CreateBundles(SubDirectory);
     }
 }
开发者ID:JaCraig,项目名称:Craig-s-Utility-Library,代码行数:36,代码来源:AssetManager.cs

示例11: RegisterBundles

        // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
        public static void RegisterBundles(BundleCollection bundles)
        {
            var jQueryBundle = new ScriptBundle("~/bundles/jquery").Include(
                "~/Scripts/jquery-{version}.js",
                "~/Scripts/jquery.cookie.js");

            jQueryBundle.IncludeDirectory("~/Scripts", "jquery.dataTables.min.js", true);
            jQueryBundle.IncludeDirectory("~/Scripts", "dataTables.bootstrap.js", true);

            bundles.Add(jQueryBundle);

            bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                "~/Scripts/jquery.validate*",
                "~/Scripts/appScripts/validation/passwordeditor.unobtrusive.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 ScriptBundle("~/bundles/appScripts").Include(
                "~/Scripts/appScripts/messages.js",
                "~/Scripts/appScripts/fileBrowsing.js",
                "~/Scripts/appScripts/dialogs.js",
                "~/Scripts/appScripts/wsp.js"
               ));

            bundles.Add(new ScriptBundle("~/bundles/appScripts-webdav").Include(
                "~/Scripts/appScripts/wsp-webdav.js"
               ));

            bundles.Add(new ScriptBundle("~/bundles/bigIconsScripts").Include(
                "~/Scripts/appScripts/recalculateResourseHeight.js"
               ));

            bundles.Add(new ScriptBundle("~/bundles/authScripts").Include(
               "~/Scripts/appScripts/authentication.js"));

            bundles.Add(new ScriptBundle("~/bundles/file-upload").Include(
                "~/Scripts/jquery.ui.widget.js",
                "~/Scripts/jQuery.FileUpload/tmpl.min.js",
                "~/Scripts/jQuery.FileUpload/load-image.min.js",
                "~/Scripts/jQuery.FileUpload/jquery.iframe-transport.js",
                "~/Scripts/jQuery.FileUpload/jquery.fileupload.js",
                "~/Scripts/jQuery.FileUpload/jquery.fileupload-process.js",
                "~/Scripts/jQuery.FileUpload/jquery.fileupload-image.js",
                "~/Scripts/jQuery.FileUpload/jquery.fileupload-validate.js",
                "~/Scripts/jQuery.FileUpload/jquery.fileupload-ui.js"
               ));

            var styleBundle = new StyleBundle("~/Content/css");

            styleBundle.Include(
                "~/Content/jQuery.FileUpload/css/jquery.fileupload.css",
                "~/Content/jQuery.FileUpload/css/jquery.fileupload-ui.css",
                "~/Content/bootstrap.css",
                "~/Content/site.css");

            styleBundle.IncludeDirectory("~/Content", "jquery.datatables.css", true);
            styleBundle.IncludeDirectory("~/Content", "dataTables.bootstrap.css", true);

            bundles.Add(styleBundle);

            // Set EnableOptimizations to false for debugging. For more information,
            // visit http://go.microsoft.com/fwlink/?LinkId=301862
            BundleTable.EnableOptimizations = true;
        }
开发者ID:lwhitelock,项目名称:Websitepanel,代码行数:72,代码来源:BundleConfig.cs


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