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


C# Navigation.NavigationBuilder类代码示例

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


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

示例1: GetNavigation

 public void GetNavigation(NavigationBuilder builder)
 {
     builder.AddImageSet("contentsync")
         .Add(root => root
                 .Caption(T("Content Sync"))
                 .Position("1")
                 .LinkToFirstChild(true)
                 .Add(child=>child.Caption(T("Overview"))
                         .Position("0")
                         .Action("Overview", "Admin", new {area = "Tad.ContentSync"})
                         .LocalNav())
                 .Add(child => child.Caption(T("Local Only"))
                         .Position("1")
                         .Action("Comparison", "Admin", new { area = "Tad.ContentSync", type = "LocalOnly" })
                         .LocalNav())
                 .Add(child => child.Caption(T("Remote Only"))
                         .Position("1")
                         .Action("Comparison", "Admin", new { area = "Tad.ContentSync", type = "RemoteOnly" })
                         .LocalNav())
                 .Add(child => child.Caption(T("Differences"))
                         .Position("1")
                         .Action("Comparison", "Admin", new { area = "Tad.ContentSync", type = "Differences" })
                         .LocalNav())
                 .Add(child => child.Caption(T("Mismatches"))
                         .Position("2")
                         .Action("Comparison", "Admin", new { area = "Tad.ContentSync", type = "Mismatches" })
                         .LocalNav()))
         .Add(T("Settings"), menu => menu
             .Add(T("Content Sync"), "99", item => item.Action("Settings", "Admin", new {area = "Tad.ContentSync"})));
 }
开发者ID:JustGiving,项目名称:Tad.ContentSync,代码行数:30,代码来源:AdminMenu.cs

示例2: GetNavigation

 public void GetNavigation(NavigationBuilder builder)
 {
     builder.AddImageSet("media")
         .Add(T("Media"), "6",
             menu => menu.Add(T("Media"), "0", item => item.Action("Index", "Admin", new { area = "Orchard.Media" })
                 .Permission(Permissions.ManageMedia)));
 }
开发者ID:stack72,项目名称:GiveCamp-London,代码行数:7,代码来源:AdminMenu.cs

示例3: GetMenu

        public void GetMenu(IContent menu, NavigationBuilder builder) {
            var menuParts = _contentManager
                .Query<MenuPart, MenuPartRecord>()
                .Where(x => x.MenuId == menu.Id)
                .WithQueryHints(new QueryHints().ExpandRecords<MenuItemPartRecord>())
                .List();

            foreach (var menuPart in menuParts) {
                if (menuPart != null) {
                    var part = menuPart;

                    string culture = null;
                    // fetch the culture of the content menu item, if any
                    var localized = part.As<ILocalizableAspect>();
                    if (localized != null) {
                        culture = localized.Culture;
                    }
                    else {
                        // fetch the culture of the content menu item, if any
                        var contentMenuItemPart = part.As<ContentMenuItemPart>();
                        if (contentMenuItemPart != null) {
                            localized = contentMenuItemPart.Content.As<ILocalizableAspect>();
                            if (localized != null) {
                                culture = localized.Culture;
                            }
                        }
                    }

                    if (part.Is<MenuItemPart>())
                        builder.Add(new LocalizedString(HttpUtility.HtmlEncode(part.MenuText)), part.MenuPosition, item => item.Url(part.As<MenuItemPart>().Url).Content(part).Culture(culture));
                    else
                        builder.Add(new LocalizedString(HttpUtility.HtmlEncode(part.MenuText)), part.MenuPosition, item => item.Action(_contentManager.GetItemMetadata(part.ContentItem).DisplayRouteValues).Content(part).Culture(culture));
                }
            }
        }
开发者ID:richinoz,项目名称:Orchard1.6,代码行数:35,代码来源:DefaultMenuProvider.cs

示例4: GetNavigation

 public void GetNavigation(NavigationBuilder builder) {
     builder.AddImageSet("users")
         .Add(T("Users"), "11",
             menu => menu.Action("Index", "Admin", new { area = "Orchard.Users" })
                 .Add(T("Users"), "1.0", item => item.Action("Index", "Admin", new { area = "Orchard.Users" })
                     .LocalNav().Permission(Permissions.ManageUsers)));
 }
开发者ID:anycall,项目名称:Orchard,代码行数:7,代码来源:AdminMenu.cs

示例5: GetNavigation

 public void GetNavigation(NavigationBuilder builder) {
     builder
         .AddImageSet("taxonomies")
         .Add(T("Taxonomies"), "4", menu => menu
         .Add(T("Manage Taxonomies"), "1.0", item => item.Action("Index", "Admin", new { area = "Orchard.Taxonomies" }).Permission(Permissions.ManageTaxonomies))
     );
 }
开发者ID:SunRobin2015,项目名称:RobinWithOrchard,代码行数:7,代码来源:AdminMenu.cs

示例6: GetNavigation

 public void GetNavigation(NavigationBuilder builder)
 {
     builder.Add("Users", "5",
                 menu => menu
                             .Add("Manage Users", "1.0", item => item.Action("Index", "Admin", new { area = "Orchard.Users" }).Permission(Permissions.ManageUsers))
                             .Add("Add New User", "1.1", item => item.Action("Create", "Admin", new { area = "Orchard.Users" }).Permission(Permissions.ManageUsers)));
 }
开发者ID:mofashi2011,项目名称:orchardcms,代码行数:7,代码来源:AdminMenu.cs

示例7: GetNavigation

 public void GetNavigation(NavigationBuilder builder)
 {
     builder
         .Add(menu => menu
             .Caption(T("OShop"))
             .Add(subMenu => subMenu
                 .Caption(T("Shipping"))
                 .Position("9")
                 .Permission(OShopPermissions.ManageShopSettings)
                 .Add(tab => tab
                     .Caption(T("Providers"))
                     .Position("1")
                     .Action("Index", "ShippingProvidersAdmin", new { area = "OShop" })
                     .Permission(OShopPermissions.ManageShopSettings)
                     .LocalNav()
                     )
                 .Add(tab => tab
                     .Caption(T("Zones"))
                     .Position("5")
                     .Action("Index", "ShippingZonesAdmin", new { area = "OShop" })
                     .Permission(OShopPermissions.ManageShopSettings)
                     .LocalNav()
                     )
             )
         );
 }
开发者ID:rtpHarry,项目名称:OShop,代码行数:26,代码来源:ShippingAdminMenu.cs

示例8: GetNavigation

 public void GetNavigation(NavigationBuilder builder) {
     builder
         .Add(T("Audit Trail"), "12", auditTrail => auditTrail
             .Add(T("Recycle Bin"), "2", history => history
                 .Action("Index", "RecycleBin", new { area = "Orchard.AuditTrail" })
                 .LocalNav()));
 }
开发者ID:RasterImage,项目名称:Orchard,代码行数:7,代码来源:RecycleBinAdminMenu.cs

示例9: GetNavigation

 public void GetNavigation(NavigationBuilder builder)
 {
     builder.AddImageSet("imagegallery")
     .Add(T("Image Gallery"), "7",
                 menu => menu.Add(T("Image Gallery"), "0", item => item.Action("Index", "Admin", new {area = "Mello.ImageGallery"})
                                                                       .Permission(Permissions.ManageImageGallery)));
 }
开发者ID:robertbird,项目名称:BoomJennies,代码行数:7,代码来源:AdminMenu.cs

示例10: GetNavigation

        public void GetNavigation(NavigationBuilder builder)
        {
            builder

                // Image set
                .AddImageSet("patrocinadores")

                // "Webshop"
                .Add(item => item

                    .Caption(T("Patrocínios"))
                    .Position("1")
                    .LinkToFirstChild(true)

                    // "Customers"
                    .Add(subItem => subItem
                        .Caption(T("Sumário"))
                        .Position("1.1")
                        .Action("Sumario", "Sumario", new { area = "Patrocinadores" })
                    )

                    // "Orders"
                    .Add(subItem => subItem
                        .Caption(T("Patrocinadores"))
                        .Position("1.2")
                        .Action("List", "PatrocinadoresAdmin", new { area = "Patrocinadores" })
                    )
                );
        }
开发者ID:NunoRodrigues,项目名称:Orchard-Patrocinios,代码行数:29,代码来源:AdminMenu.cs

示例11: GetNavigation

 public void GetNavigation(NavigationBuilder builder)
 {
     builder.AddImageSet("modules")
         .Add(T("Modules"), "9", menu => menu.Action("Features", "Admin", new {area = "Orchard.Modules"}).Permission(Permissions.ManageFeatures)
             .Add(T("Features"), "0", item => item.Action("Features", "Admin", new {area = "Orchard.Modules"}).Permission(Permissions.ManageFeatures).LocalNav())
             .Add(T("Installed"), "1", item => item.Action("Index", "Admin", new {area = "Orchard.Modules"}).Permission(StandardPermissions.SiteOwner).LocalNav()));
 }
开发者ID:stack72,项目名称:GiveCamp-London,代码行数:7,代码来源:AdminMenu.cs

示例12: GetNavigation

 public void GetNavigation(NavigationBuilder builder)
 {
     builder.Add(T("Settings"), "50",
         menu => menu
             .Add(T("MailChimp API Key"), "10", item => item.Action("Index", "Admin", new { area = "NogginBox.MailChimp" })
                 .Permission(StandardPermissions.SiteOwner)));
 }
开发者ID:Timbioz,项目名称:SciGitAzure,代码行数:7,代码来源:AdminMenu.cs

示例13: GetNavigation

        public void GetNavigation(NavigationBuilder builder) {

            var menus = Services.ContentManager.Query<TitlePart, TitlePartRecord>().OrderBy(x => x.Title).ForType("Menu").List().ToList();
            int firstMenuIndex = 0;
            menus.ForEach(c => {
                builder.AddImageSet(c.Title)
                   .Add(T(c.Title), (++firstMenuIndex).ToString(),
                        menu =>
                        {
                            int menuIdex = 0;
                            var subMenus = _menuService.GetMenuParts(c.Id).
                                OrderBy(menuPartEntry => menuPartEntry.MenuPosition, 
                                new FlatPositionComparer()).ToList();
                            foreach (var subMenu in subMenus) {

                                //var moduleMenuItem = c.As<ModuleMenuItemPart>();
                                //if(moduleMenuItem!=null) {
                                
                                //}

                                var menuItemEntity = CreateMenuItemEntries(subMenu);
                                var moduleMenuItem = subMenu.As<ModuleMenuItemPart>();
                                if (moduleMenuItem != null) {
                                    menu.Add(T(menuItemEntity.Text), (++menuIdex).ToString(), item => item.Url(menuItemEntity.Url), new List<string>() { moduleMenuItem.IconClass});
                                }
                                else
                                {
                                    menu.Add(T(menuItemEntity.Text), (++menuIdex).ToString(), item => item.Url(menuItemEntity.Url));   
                                }
                            }
                        });
            });
        }
开发者ID:jgtaveras,项目名称:Coevery,代码行数:33,代码来源:FrontMenu.cs

示例14: GetNavigation

 public void GetNavigation(NavigationBuilder builder) {
     builder
         .Add(T("Settings"), menu => menu
             .Add(T("Open Authentication"), "10.0", subMenu => subMenu.Action("Index", "Admin", new { area = Constants.LocalArea }).Permission(StandardPermissions.SiteOwner)
                 .Add(T("Settings"), "10.0", item => item.Action("Index", "Admin", new { area = Constants.LocalArea }).Permission(StandardPermissions.SiteOwner).LocalNav())
             ));
 }
开发者ID:li0803,项目名称:NGM.OpenAuthentication,代码行数:7,代码来源:AdminMenu.cs

示例15: GetNavigation

 public void GetNavigation(NavigationBuilder builder)
 {
     // Connections menu for Graph viewing (not implemented)
  /*   builder.Add(T("Connections"), "5", menu => menu
         .Action("Connections"));
    */ 
 }
开发者ID:akhurst,项目名称:ricealumni,代码行数:7,代码来源:AdminMenu.cs


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