本文整理汇总了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;
}
示例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)
};
}
示例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)
};
}
示例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)
};
}
示例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) };
}
}
示例6: GetUrls
public List<string> GetUrls(IUrlGenerator urlGenerator, bool isDebuggingEnabled)
{
return new List<string> { urlGenerator.CreateBundleUrl(this.Bundle) + "?"};
}