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


C# Bundle.AddDirectory方法代码示例

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


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

示例1: 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);
 }
开发者ID:arneeiri,项目名称:OpenRestWorkshop,代码行数:8,代码来源:Global.asax.cs

示例2: 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);
        }
开发者ID:shayaneumar,项目名称:gabbar,代码行数:28,代码来源:CasesAreaRegistration.cs

示例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();
        }
开发者ID:stevegreatrex,项目名称:SketchPad,代码行数:26,代码来源:Global.asax.cs

示例4: Application_Start

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);

            //BundleTable.Bundles.RegisterTemplateBundles();

            #if DEBUG
            var javascriptLibraries = new Bundle("~/lib");
            javascriptLibraries.AddDirectory("~/Scripts/lib", "*.js", false);
            BundleTable.Bundles.Add(javascriptLibraries);

            var javascriptApp = new Bundle("~/app");
            javascriptApp.AddDirectory("~/Scripts/app", "*.js", false);
            BundleTable.Bundles.Add(javascriptApp);
            #else
            var javascriptLibraries = new Bundle("~/lib", new JsMinify());
            javascriptLibraries.AddDirectory("~/Scripts/lib", "*.js", false);
            BundleTable.Bundles.Add(javascriptLibraries);

            var javascriptApp = new Bundle("~/app", new JsMinify());
            javascriptApp.AddDirectory("~/Scripts/app", "*.js", false);
            BundleTable.Bundles.Add(javascriptApp);
            #endif
        }
开发者ID:davidein,项目名称:Ru.GameSchool,代码行数:27,代码来源:Global.asax.cs

示例5: Init

        public static void Init()
        {
            #if DEBUG
            _debug = true;
            #endif
            var bundle = new Bundle("~/js/app");

            bundle.AddDirectory("~/js/app", "*.js", true, true);

            BundleTable.Bundles.Add(bundle);
        }
开发者ID:pmarshallandrew,项目名称:releaseit,代码行数:11,代码来源:CustomJsBundle.cs

示例6: RegisterBundles

 private void RegisterBundles()
 {
     var bundle = new Bundle("~/Scripts/cors/js", new JsMinify());
     bundle.AddDirectory("~/Scripts/cors", "*.js", true);
     BundleTable.Bundles.Add(bundle);
     bundle = new Bundle("~/Scripts/wow/js", new JsMinify());
     bundle.AddDirectory("~/Scripts/wow", "*.js", true);
     BundleTable.Bundles.Add(bundle);
     bundle = new Bundle("~/Content/wow/css", new CssMinify());
     bundle.AddDirectory("~/Content/wow", "*.css", true);
     BundleTable.Bundles.Add(bundle);
     bundle = new Bundle("~/Content/fileupload/css", new CssMinify());
     bundle.AddDirectory("~/Content/fileupload", "*.css", true);
     BundleTable.Bundles.Add(bundle);
 }
开发者ID:slashP,项目名称:Solbakken,代码行数:15,代码来源:Global.asax.cs

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

            BundleTable.Bundles.RegisterTemplateBundles();
            var customBundle = new Bundle("~/Scripts/mine");
            customBundle.AddDirectory("~/Scripts/custom", "*.js", false, true);
            BundleTable.Bundles.Add(customBundle);
        }
开发者ID:adbrowne,项目名称:Samples,代码行数:15,代码来源:Global.asax.cs

示例8: Application_Start

        protected void Application_Start()
        {
            InitMapper();
            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);

            var moduleBundle = new Bundle("~/Scripts/modules/js", new JsMinify());
            moduleBundle.AddDirectory("~/Scripts/modules","*.js");
            BundleTable.Bundles.Add(moduleBundle);
            BundleTable.Bundles.RegisterTemplateBundles();

            ControllerBuilder.Current.SetControllerFactory(new NinjectControllerBuilder(Kernel));
        }
开发者ID:smoothfriction,项目名称:Gazette,代码行数:15,代码来源:Global.asax.cs

示例9: PerformBundling

        public static void PerformBundling()
        {
            IBundleTransform jstransformer;
            IBundleTransform csstransformer;
#if DEBUG
            jstransformer = new NoTransform("text/javascript");
            csstransformer = new NoTransform("text/css");
#else
            jstransformer = new JsMinify();
            csstransformer = new CssMinify();
#endif

            //var bundle = new Bundle("~/WeNeedLibraries", jstransformer);
            //bundle.AddDirectory("~/ClientSideResources/js/libraries", "*.js");
            //BundleTable.Bundles.Add(bundle);

            var bundle = new Bundle("~/WeNeedPlugIns", jstransformer);
            var modelsOrdering = new BundleFileSetOrdering("plugins");
            modelsOrdering.Files.Add("jquery.fileupload.js");
            modelsOrdering.Files.Add("");
            BundleTable.Bundles.FileSetOrderList.Add(modelsOrdering);
            bundle.AddDirectory("~/ClientSideResources/js/plugIns", "*.js");
            BundleTable.Bundles.Add(bundle);

            bundle = new Bundle("~/WeNeedModels", jstransformer);
            modelsOrdering = new BundleFileSetOrdering("models");
            modelsOrdering.Files.Add("WeNeedUHave.Model.js");
            BundleTable.Bundles.FileSetOrderList.Add(modelsOrdering);
            bundle.AddDirectory("~/ClientSideResources/js/models", "*.js");
            BundleTable.Bundles.Add(bundle);

            bundle = new Bundle("~/WeNeedHttp", jstransformer);
            bundle.AddDirectory("~/ClientSideResources/js/http", "*.js");
            BundleTable.Bundles.Add(bundle);

            bundle = new Bundle("~/WeNeedViewModels", jstransformer);
            modelsOrdering = new BundleFileSetOrdering("viewModels");
            modelsOrdering.Files.Add("WeNeedUHave.ViewModel.js");
            modelsOrdering.Files.Add("WeNeedUHave.ViewModel.Payment.js");
            BundleTable.Bundles.FileSetOrderList.Add(modelsOrdering);
            bundle.AddDirectory("~/ClientSideResources/js/viewModels", "*.js");
            BundleTable.Bundles.Add(bundle);

            bundle = new Bundle("~/ClientSideResources/css/1", csstransformer);
            bundle.AddDirectory("~/ClientSideResources/css", "*.css");
            BundleTable.Bundles.Add(bundle);
        }
开发者ID:IanFelton,项目名称:WeNeedUHave,代码行数:47,代码来源:WeNeedUHaveBundler.cs

示例10: Application_Start

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);

            var bundle = new Bundle("~/Content/styles", new CssMinify());
            bundle.AddDirectory("~/Content/styles", "*.css", true);
            BundleTable.Bundles.Add(bundle);

            bundle = new Bundle("~/Scripts/js", new JsMinify());
            bundle.AddDirectory("~/Scripts/js", "*.js", true);
            BundleTable.Bundles.Add(bundle);

            BundleTable.Bundles.RegisterTemplateBundles();
        }
开发者ID:SomeHero,项目名称:Admin-Portal,代码行数:17,代码来源:Global.asax.cs

示例11: RegisterBundles

        private void RegisterBundles(BundleCollection bundles)
        {
            var libBundle = new Bundle("~/scripts/lib", typeof(NoTransform));
            libBundle.AddFile("~/scripts/jquery-1.7.2.js");
            libBundle.AddFile("~/scripts/jquery-ui-1.8.20.js");
            libBundle.AddFile("~/scripts/jquery.tmpl.js");
            libBundle.AddFile("~/scripts/knockout-2.1.0.debug.js");
            libBundle.AddFile("~/scripts/knockout.simpleGrid.js");
            libBundle.AddFile("~/scripts/underscore.js");
            libBundle.AddFile("~/scripts/json2.js");
            libBundle.AddFile("~/scripts/storage.js");
            bundles.Add(libBundle);

            var localBundle = new Bundle("~/scripts/local", typeof(NoTransform));
            localBundle.AddDirectory("~/scripts/models/", "*.js", false);
            bundles.Add(localBundle);
        }
开发者ID:djeebus,项目名称:SteamMatchUp,代码行数:17,代码来源:Global.asax.cs

示例12: 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");
            Database.SetInitializer(new DropCreateDatabaseIfModelChanges<AtndDB>());

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);

            BundleTable.Bundles.RegisterTemplateBundles();

            var bundle = new Bundle("~/Hack/js");
            bundle.AddDirectory("~/Scripts", "Hack*.js", throwIfNotExist: false);
            BundleTable.Bundles.Add(bundle);
        }
开发者ID:jsakamoto,项目名称:mvc-clrh-atnd-cod2012,代码行数:17,代码来源:Global.asax.cs

示例13: Application_Start

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);

            Bundle cssBundle = new Bundle("~/Content/css", new CssMinify());
            cssBundle.AddDirectory("~/Content", "*min.css");
            cssBundle.AddFile("~/Content/Site.css");
            BundleTable.Bundles.Add(cssBundle);

            Bundle javascriptBundle = new Bundle("~/Scripts/js", new NoTransform());//, new JsMinify());
            //scripts.AddDirectory("~/Scripts", "*min.js");
            javascriptBundle.AddFile("~/Scripts/underscore.js");
            javascriptBundle.AddFile("~/Scripts/json2.js");
            javascriptBundle.AddFile("~/Scripts/jquery-1.7.2.js");
            BundleTable.Bundles.Add(javascriptBundle);
        }
开发者ID:saitodisse,项目名称:aspnet-webapi-knockout-restfull,代码行数:19,代码来源:Global.asax.cs

示例14: Application_Start

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);

            var jsBundle = new Bundle("~/Scripts/js", new JsMinify());
            jsBundle.AddFile("~/Scripts/jquery-1.7.2.js");
            jsBundle.AddFile("~/Scripts/modernizr-2.5.3.js");
            jsBundle.AddFile("~/Scripts/jquery.tipsy.js");
            jsBundle.AddFile("~/Scripts/knockout.js");
            jsBundle.AddFile("~/Scripts/jquery.clippy.min.js");
            jsBundle.AddFile("~/scripts/ListTool.js");
            BundleTable.Bundles.Add(jsBundle);

            var cssBundle = new Bundle("~/Content/css", new CssMinify());
            cssBundle.AddDirectory("~/Content/", "*.css", true);
            BundleTable.Bundles.Add(cssBundle);
        }
开发者ID:tekmaven,项目名称:SqlQueryTools,代码行数:20,代码来源:Global.asax.cs

示例15: SetupBundle

 private static void SetupBundle(string path, IBundleTransform transform)
 {
     var cssBundle = new Bundle(path, transform);
     cssBundle.AddDirectory("~/Content", "*.less", true);
     BundleTable.Bundles.Add(cssBundle);
 }
开发者ID:pawelpabich,项目名称:SampleBundleImplementationsForLess,代码行数:6,代码来源:Global.asax.cs


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