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


C# IUrlGenerator.CreateBundleUrl方法代码示例

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


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

示例1: GetUrls

        public List<string> GetUrls(IUrlGenerator urlGenerator, bool isDebuggingEnabled)
        {
            string path = isDebuggingEnabled
                             ? urlGenerator.CreateAssetUrl(Asset)
                             : urlGenerator.CreateBundleUrl(Bundle) + "?";

            var urls = new List<string> { path };
            var externalBundle = Bundle as IExternalBundle;
            if (externalBundle != null)
            {
                var externalUrl = externalBundle.ExternalUrl;
                if (externalUrl.EndsWith(".js"))
                {
                    externalUrl = externalUrl.Substring(0, externalUrl.Length - 3);
                }
               urls.Insert(0,externalUrl);
            }
            return urls;
        }
开发者ID:joplaal,项目名称:cassette,代码行数:19,代码来源:AssetModule.cs

示例2: StylesheetData

 object StylesheetData(StylesheetBundle stylesheet, IUrlGenerator urlGenerator)
 {
     var external = stylesheet as ExternalStylesheetBundle;
     return new
     {
         stylesheet.Path,
         Url = external == null ? urlGenerator.CreateBundleUrl(stylesheet) : external.Url,
         stylesheet.Media,
         stylesheet.Condition,
         Assets = AssetPaths(stylesheet, urlGenerator),
         stylesheet.References,
         Size = BundleSize(stylesheet)
     };
 }
开发者ID:JamesTryand,项目名称:cassette,代码行数:14,代码来源:HudRequestHandler.cs

示例3: ScriptData

 object ScriptData(ScriptBundle script, IUrlGenerator urlGenerator)
 {
     var external = script as ExternalScriptBundle;
     return new
     {
         script.Path,
         Url = external == null ? urlGenerator.CreateBundleUrl(script) : external.Url,
         Assets = AssetPaths(script, urlGenerator),
         script.References,
         Size = BundleSize(script)
     };
 }
开发者ID:JamesTryand,项目名称:cassette,代码行数:12,代码来源:HudRequestHandler.cs

示例4: HtmlTemplateData

 object HtmlTemplateData(HtmlTemplateBundle htmlTemplate, IUrlGenerator urlGenerator)
 {
     return new
     {
         htmlTemplate.Path,
         Url = urlGenerator.CreateBundleUrl(htmlTemplate),
         Assets = AssetPaths(htmlTemplate, urlGenerator),
         htmlTemplate.References,
         Size = BundleSize(htmlTemplate)
     };
 }
开发者ID:JamesTryand,项目名称:cassette,代码行数:11,代码来源:HudRequestHandler.cs

示例5: GetUrls

 internal virtual IEnumerable<string> GetUrls(bool isDebuggingEnabled, IUrlGenerator urlGenerator)
 {
     if (isDebuggingEnabled)
     {
         var collector = new CollectLeafAssets();
         Accept(collector);
         return collector.Assets.Select(urlGenerator.CreateAssetUrl);
     }
     else
     {
         return new[] { urlGenerator.CreateBundleUrl(this) };
     }
 }
开发者ID:prabirshrestha,项目名称:cassette,代码行数:13,代码来源:Bundle.cs

示例6: GetUrls

 public List<string> GetUrls(IUrlGenerator urlGenerator, bool isDebuggingEnabled)
 {
     return new List<string> { urlGenerator.CreateBundleUrl(this.Bundle)  + "?"};
 }
开发者ID:joplaal,项目名称:cassette,代码行数:4,代码来源:BundleScriptModule.cs


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