本文整理汇总了C#中Orchard.UI.Navigation.NavigationBuilder.Build方法的典型用法代码示例。如果您正苦于以下问题:C# NavigationBuilder.Build方法的具体用法?C# NavigationBuilder.Build怎么用?C# NavigationBuilder.Build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orchard.UI.Navigation.NavigationBuilder
的用法示例。
在下文中一共展示了NavigationBuilder.Build方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSources
private IEnumerable<IEnumerable<MenuItem>> GetSources(IContent menu) {
foreach (var provider in _menuProviders) {
var builder = new NavigationBuilder();
IEnumerable<MenuItem> items = null;
try {
provider.GetMenu(menu, builder);
items = builder.Build();
}
catch (Exception ex) {
if (ex.IsFatal()) {
throw;
}
Logger.Error(ex, "Unexpected error while querying a menu provider. It was ignored. The menu provided by the provider may not be complete.");
}
if (items != null) {
yield return items;
}
}
}
示例2: AllSources
private IEnumerable<IEnumerable<MenuItem>> AllSources(string menuName)
{
foreach (var provider in _providers) {
if (provider.MenuName == menuName) {
var builder = new NavigationBuilder();
provider.GetNavigation(builder);
yield return builder.Build();
}
}
}
示例3: GetSources
private IEnumerable<IEnumerable<MenuItem>> GetSources(string menuName) {
foreach (var provider in _navigationProviders) {
if (provider.MenuName == menuName) {
var builder = new NavigationBuilder();
IEnumerable<MenuItem> items = null;
try {
provider.GetNavigation(builder);
items = builder.Build();
}
catch (Exception ex) {
Logger.Error(ex, "Unexpected error while querying a navigation provider. It was ignored. The menu provided by the provider may not be complete.");
}
if (items != null) {
yield return items;
}
}
}
}