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


C# NavigationBuilder.Build方法代码示例

本文整理汇总了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;
         }
     }
 }
开发者ID:SeyDutch,项目名称:Gilde,代码行数:19,代码来源:NavigationManager.cs

示例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();
         }
     }
 }
开发者ID:mofashi2011,项目名称:orchardcms,代码行数:10,代码来源:NavigationManager.cs

示例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;
             }
         }
     }
 }
开发者ID:richinoz,项目名称:Orchard1.6,代码行数:18,代码来源:NavigationManager.cs


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