• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Configuration.CassetteSettings类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Configure

        public void Configure(BundleCollection bundles, CassetteSettings settings)
        {
            // TODO: Configure your bundles here...
            // Please read http://getcassette.net/documentation/configuration

            // This default configuration treats each file as a separate 'bundle'.
            // In production the content will be minified, but the files are not combined.
            // So you probably want to tweak these defaults!
            //bundles.AddPerIndividualFile<StylesheetBundle>("Content");
            //bundles.AddPerIndividualFile<ScriptBundle>("Scripts");

            bundles.Add<ScriptBundle>("Content/app");

            bundles.Add<StylesheetBundle>("Content/assets/css");
            bundles.Add<HtmlTemplateBundle>("Content/assets/templates", bundle => bundle.Processor = new HoganPipeline());
            bundles.AddPerSubDirectory<ScriptBundle>("Content/assets/js");

            bundles.Add<ScriptBundle>("Scripts", new FileSearch { Exclude = new Regex("_references.js|-vsdoc\\.js$")});

            // To combine files, try something like this instead:
            //   bundles.Add<StylesheetBundle>("Content");
            // In production mode, all of ~/Content will be combined into a single bundle.

            // If you want a bundle per folder, try this:
            //   bundles.AddPerSubDirectory<ScriptBundle>("Scripts");
            // Each immediate sub-directory of ~/Scripts will be combined into its own bundle.
            // This is useful when there are lots of scripts for different areas of the website.

            // *** TOP TIP: Delete all ".min.js" files now ***
            // Cassette minifies scripts for you. So those files are never used.
        }
开发者ID:scottccoates,项目名称:BootstrapBackboneMVCFun,代码行数:31,代码来源:CassetteConfiguration.cs


示例2: Configure

        public void Configure(BundleCollection bundles, CassetteSettings settings)
        {
            // TODO: Configure your bundles here...
            // Please read http://getcassette.net/documentation/configuration

            // This default configuration treats each file as a separate 'bundle'.
            // In production the content will be minified, but the files are not combined.
            // So you probably want to tweak these defaults!
            bundles.Add<StylesheetBundle>("assets/css");
            bundles.Add<ScriptBundle>("assets/js");

            bundles.AddUrlWithAlias<ScriptBundle>("https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js", "jquery");
            bundles.AddUrlWithAlias<ScriptBundle>("https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js", "jquery-ui");
            bundles.AddUrlWithAlias<ScriptBundle>("http://ajax.aspnetcdn.com/ajax/knockout/knockout-2.1.0.js", "knockout");

            //<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
            //<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
            //<script src="http://ajax.aspnetcdn.com/ajax/knockout/knockout-2.1.0.js"></script>

            // To combine files, try something like this instead:
            //   bundles.Add<StylesheetBundle>("Content");
            // In production mode, all of ~/Content will be combined into a single bundle.

            // If you want a bundle per folder, try this:
            //   bundles.AddPerSubDirectory<ScriptBundle>("Scripts");
            // Each immediate sub-directory of ~/Scripts will be combined into its own bundle.
            // This is useful when there are lots of scripts for different areas of the website.

            // *** TOP TIP: Delete all ".min.js" files now ***
            // Cassette minifies scripts for you. So those files are never used.
        }
开发者ID:nbirkes,项目名称:nathan-music,代码行数:31,代码来源:CassetteConfiguration.cs


示例3: ExternalStylesheetHtmlRenderer_Tests

 public ExternalStylesheetHtmlRenderer_Tests()
 {
     settings = new CassetteSettings("");
     fallbackRenderer = new Mock<IBundleHtmlRenderer<StylesheetBundle>>();
     renderer = new ExternalStylesheetHtmlRenderer(fallbackRenderer.Object, settings);
     bundle = new ExternalStylesheetBundle("http://test.com/");
 }
开发者ID:ChrisMH,项目名称:cassette,代码行数:7,代码来源:ExternalStylesheetHtmlRenderer.cs


示例4: Configure

        public void Configure(BundleCollection bundles, CassetteSettings settings)
        {
            bundles.Add<StylesheetBundle>(@"Content\lib", new FileSearch
                                                              {
                                                                  Pattern = "*.css;*.less",
                                                                  SearchOption = SearchOption.AllDirectories
                                                              });
            bundles.AddPerIndividualFile<StylesheetBundle>(@"Content\Views",
                                                           new FileSearch
                                                               {
                                                                   Pattern = "*.css;*.less",
                                                                   SearchOption = SearchOption.AllDirectories
                                                               });

            bundles.Add<ScriptBundle>(@"Scripts\lib", new FileSearch
                                                          {
                                                              Pattern = "*.js;*.coffee",
                                                              Exclude = new Regex("-vsdoc\\.js$"),
                                                              SearchOption = SearchOption.AllDirectories
                                                          });
            bundles.AddPerIndividualFile<ScriptBundle>(@"Scripts\Views", new FileSearch
                                                                             {
                                                                                 Pattern = "*.js;*.coffee",
                                                                                 Exclude = new Regex("-vsdoc\\.js$"),
                                                                                 SearchOption = SearchOption.AllDirectories
                                                                             });
        }
开发者ID:Zero41,项目名称:Moose,代码行数:27,代码来源:CassetteConfiguration.cs


示例5: CreateExternalBundle

 Bundle CreateExternalBundle(string reference, Bundle referencer, CassetteSettings settings)
 {
     var bundleFactory = GetBundleFactory(referencer.GetType());
     var externalBundle = bundleFactory.CreateExternalBundle(reference);
     externalBundle.Process(settings);
     return externalBundle;
 }
开发者ID:JamesTryand,项目名称:cassette,代码行数:7,代码来源:BundleContainerFactoryBase.cs


示例6: CreateExternalBundlesFromReferences

        protected IEnumerable<Bundle> CreateExternalBundlesFromReferences(IEnumerable<Bundle> bundlesArray, CassetteSettings settings)
        {
            var referencesAlreadyCreated = new HashSet<string>();
            foreach (var bundle in bundlesArray)
            {
                foreach (var reference in bundle.References)
                {
                    if (reference.IsUrl() == false) continue;
                    if (referencesAlreadyCreated.Contains(reference)) continue;

                    var externalBundle = CreateExternalBundle(reference, bundle, settings);
                    referencesAlreadyCreated.Add(externalBundle.Path);
                    yield return externalBundle;
                }
                foreach (var asset in bundle.Assets)
                {
                    foreach (var assetReference in asset.References)
                    {
                        if (assetReference.Type != AssetReferenceType.Url ||
                            referencesAlreadyCreated.Contains(assetReference.Path)) continue;

                        var externalBundle = CreateExternalBundle(assetReference.Path, bundle, settings);
                        referencesAlreadyCreated.Add(externalBundle.Path);
                        yield return externalBundle;
                    }
                }
            }
        }
开发者ID:prasanths,项目名称:cassette,代码行数:28,代码来源:BundleContainerFactoryBase.cs


示例7: CreateBundleCore

 protected override Bundle CreateBundleCore(CassetteSettings settings)
 {
     return new ExternalScriptBundle(Url, Path, FallbackCondition)
     {
         Renderer = new ConstantHtmlRenderer<ScriptBundle>(Html(), settings.UrlModifier)
     };
 }
开发者ID:nlerikheemskerk,项目名称:cassette,代码行数:7,代码来源:ExternalScriptBundleManifest.cs


示例8: Configure

        public void Configure(BundleCollection bundles, CassetteSettings settings)
        {
            // TODO: Configure your bundles here...
            // Please read http://getcassette.net/documentation/configuration

            // This default configuration treats each file as a separate 'bundle'.
            // In production the content will be minified, but the files are not combined.
            // So you probably want to tweak these defaults!
            bundles.AddPerSubDirectory<ScriptBundle>("Scripts");

            // To combine files, try something like this instead:
            bundles.Add<StylesheetBundle>("Content", new FileSearch
                                                         {
                                                             Pattern = "*.css;*.less",
                                                             SearchOption = SearchOption.AllDirectories,
                                                             Exclude = new Regex("base")
                                                         });
            // In production mode, all of ~/Content will be combined into a single bundle.

            // If you want a bundle per folder, try this:
            //   bundles.AddPerSubDirectory<ScriptBundle>("Scripts");
            // Each immediate sub-directory of ~/Scripts will be combined into its own bundle.
            // This is useful when there are lots of scripts for different areas of the website.

            // *** TOP TIP: Delete all ".min.js" files now ***
            // Cassette minifies scripts for you. So those files are never used.
        }
开发者ID:gan123,项目名称:RightRecruit,代码行数:27,代码来源:CassetteConfiguration.cs


示例9: ProcessAllBundles

 protected void ProcessAllBundles(IEnumerable<Bundle> bundles, CassetteSettings settings)
 {
     foreach (var bundle in bundles)
     {
         bundle.Process(settings);
     }
 }
开发者ID:prasanths,项目名称:cassette,代码行数:7,代码来源:BundleContainerFactoryBase.cs


示例10: Configure

		public void Configure(BundleCollection bundles, CassetteSettings settings)
		{
			// Stylesheets
			bundles.AddUrlWithAlias<StylesheetBundle>("http://fonts.googleapis.com/css?family=PT+Sans", "font-ptsans");
			bundles.AddUrlWithAlias<StylesheetBundle>("http://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700,300italic,400italic,500italic,700italic", "font-ubuntu");
			bundles.AddUrlWithAlias<StylesheetBundle>("http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,600,700,800,300", "font-opensans");
			bundles.AddPerSubDirectory<StylesheetBundle>("Styles", new FileSearch { Pattern = "*.css;*.less" });

			// Scripts
			bundles.AddPerSubDirectory<ScriptBundle>("Scripts", new FileSearch
			{
			    Pattern = "*.js;*.coffee",
				Exclude = new Regex("-vsdoc\\.js$"), // Excludes the VS documentation files
				SearchOption = SearchOption.AllDirectories
			});

			// HtmlTemplates
			bundles.Add<HtmlTemplateBundle>(
				"Views/Templates",
				new FileSearch 
				{
					Pattern = "*.htm;*.html",
					SearchOption = SearchOption.AllDirectories
				}
				/*,
				// Assign the jQuery-tmpl processor to the HTML template bundles
				bundle => bundle.Processor = new KnockoutJQueryTmplPipeline()*/);
		}
开发者ID:Stephanvs,项目名称:Hayman.Lighthouse,代码行数:28,代码来源:CassetteConfiguration.cs


示例11: Configure

 public void Configure(BundleCollection bundles, CassetteSettings settings)
 {
     if (settings.UrlGenerator == null)
     {
         settings.UrlGenerator = new UrlGenerator(settings.UrlModifier, UrlGenerator.RoutePrefix);
     }
 }
开发者ID:Zocdoc,项目名称:cassette,代码行数:7,代码来源:AssignUrlGenerator.cs


示例12: Process

 internal override void Process(CassetteSettings settings)
 {
     // Any fallback assets are processed like a regular ScriptBundle.
     base.Process(settings);
     // We just need a special renderer instead.
     externalRenderer = new ExternalScriptBundleHtmlRenderer(Renderer, settings);
 }
开发者ID:JamesTryand,项目名称:cassette,代码行数:7,代码来源:ExternalScriptBundle.cs


示例13: Configure

        public void Configure(BundleCollection bundles, CassetteSettings settings)
        {
            // The "Scripts/app" contains the application script we'll be testing with Jasmine.
            // The "Scripts/specs" contains the Jasmine specs. It is treated just like a regular Cassette bundle.

            bundles.AddPerSubDirectory<ScriptBundle>("Scripts");
        }
开发者ID:nlerikheemskerk,项目名称:cassette,代码行数:7,代码来源:CassetteConfiguration.cs


示例14: GivenCacheIsUpToDate_WhenInitializeBundlesFromCacheIfUpToDate_ThenBundleAssetsReplacedWithCachedAsset

        public void GivenCacheIsUpToDate_WhenInitializeBundlesFromCacheIfUpToDate_ThenBundleAssetsReplacedWithCachedAsset()
        {
            using (var cacheDir = new TempDirectory())
            {
                File.WriteAllText(
                    Path.Combine(cacheDir, "container.xml"),
                    "<?xml version=\"1.0\"?><Container Version=\"VERSION\" AssetCount=\"1\"><Bundle Path=\"~/test\" Hash=\"01\"/></Container>"
                    );
                File.WriteAllText(
                    Path.Combine(cacheDir, "test.bundle"),
                    "asset"
                    );
                var bundleWithAsset = new TestableBundle("~/test");
                var asset = StubAsset();
                bundleWithAsset.Assets.Add(asset.Object);
                var sourceBundles = new[] { bundleWithAsset };

                var settings = new CassetteSettings("")
                {
                    SourceDirectory = Mock.Of<IDirectory>(),
                    CacheDirectory = new FileSystemDirectory(cacheDir)
                };
                var cache = new BundleCache("VERSION", settings);
                var result = cache.InitializeBundlesFromCacheIfUpToDate(sourceBundles);

                result.ShouldBeTrue();
                bundleWithAsset.Assets[0].OpenStream().ReadToEnd().ShouldEqual("asset");
            }
        }
开发者ID:hempels,项目名称:cassette,代码行数:29,代码来源:BundleCache.cs


示例15: ExternalScriptBundleHtmlRenderer_Tests

 public ExternalScriptBundleHtmlRenderer_Tests()
 {
     settings = new CassetteSettings("")
     {
         IsDebuggingEnabled = false
     };
 }
开发者ID:jimmah,项目名称:cassette,代码行数:7,代码来源:ExternalScriptBundleHtmlRenderer.cs


示例16: Configure

        public void Configure(BundleCollection bundles, CassetteSettings settings)
        {
            // TODO: Configure your bundles here...
            // Please read http://getcassette.net/documentation/configuration

            bundles.Add<StylesheetBundle>("Content");
            bundles.Add<ScriptBundle>("Scripts");
        }
开发者ID:mccalltd,项目名称:MvcStarterTemplate,代码行数:8,代码来源:CassetteConfiguration.cs


示例17: CreateBundleCore

 protected override Bundle CreateBundleCore(CassetteSettings settings)
 {
     return new ScriptBundle(Path)
     {
         Condition = Condition,
         Renderer = new ConstantHtmlRenderer<ScriptBundle>(Html(), settings.UrlModifier)
     };
 }
开发者ID:nlerikheemskerk,项目名称:cassette,代码行数:8,代码来源:ScriptBundleManifest.cs


示例18: CassetteApplication

 public CassetteApplication(IBundleContainer bundleContainer,
     CassetteSettings settings,
     Func<HttpContextBase> getCurrentHttpContext,
     IDependencyGraphInteractionFactory dependencyGraphFactory)
     : base(bundleContainer, settings, dependencyGraphFactory)
 {
     this.getCurrentHttpContext = getCurrentHttpContext;
 }
开发者ID:Zocdoc,项目名称:cassette,代码行数:8,代码来源:CassetteApplication.cs


示例19: BundleCache

 public BundleCache(string version, CassetteSettings settings)
 {
     this.version = version;
     this.settings = settings;
     cacheDirectory = settings.CacheDirectory;
     sourceDirectory = settings.SourceDirectory;
     containerFile = cacheDirectory.GetFile(ContainerFilename);
 }
开发者ID:hempels,项目名称:cassette,代码行数:8,代码来源:BundleCache.cs


示例20: CassetteConfiguration_WhenConfigure

        public CassetteConfiguration_WhenConfigure()
        {
            var config = new CassetteConfiguration();
            var settings = new CassetteSettings("");
            bundles = new BundleCollection(settings);

            config.Configure(bundles, settings);
        }
开发者ID:ryansroberts,项目名称:cassette,代码行数:8,代码来源:CassetteConfiguration.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Scripts.ScriptBundle类代码示例发布时间:2022-05-24
下一篇:
C# Cassette.TestableBundle类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap