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


C# NavigationBuilder.Add方法代码示例

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


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

示例1: 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

示例2: GetMenu

 public void GetMenu(Orchard.ContentManagement.IContent menu, NavigationBuilder builder)
 {
     builder.Add(T("Lifestyle"), "2", item => item.Action("Index", "Lifestyle", new { area = "Pharmalto.Ecosystem" }));
     builder.Add(T("Supplements"), "2", item => item.Action("Index", "Supplements", new { area = "Pharmalto.Ecosystem" }));
     //builder.Add(T("My Groups"), "2", item => item.Action("Index", "Groups", new { area = "Pharmalto.Ecosystem" }));
     //builder.Add(T("My Albums"), "2", item => item.Action("Index", "Album", new { area = "Pharmalto.Ecosystem" }));
     //builder.Add(T("My Gallery"), "2", item => item.Action("Index", "Gallery", new { area = "Pharmalto.Ecosystem" }));
     //builder.Add(T("My Health Plan"), "2", item => item.Action("Index", "HealthPlan", new { area = "Pharmalto.Ecosystem" }));
     //builder.Add(T("My Health Tracker"), "2", item => item.Action("Index", "Fitness", new { area = "Pharmalto.Ecosystem" }));
 }
开发者ID:CloudMetal,项目名称:Ecosystem-Deployment,代码行数:10,代码来源:EcosystemMenuProvider.cs

示例3: GetNavigation

        public void GetNavigation(NavigationBuilder builder) {
            var menuParts = _contentManager.Query<MenuPart, MenuPartRecord>().Where(x => x.OnMainMenu).WithQueryHints(new QueryHints().ExpandRecords<MenuItemPartRecord>()).List();
            foreach (var menuPart in menuParts) {
                if (menuPart != null) {
                    var part = menuPart;

                    if (part.Is<MenuItemPart>())
                        builder.Add(new LocalizedString(HttpUtility.HtmlEncode(part.MenuText)), part.MenuPosition, item => item.Url(part.As<MenuItemPart>().Url));
                    else
                        builder.Add(new LocalizedString(HttpUtility.HtmlEncode(part.MenuText)), part.MenuPosition, item => item.Action(_contentManager.GetItemMetadata(part.ContentItem).DisplayRouteValues));
                }
            }
        }
开发者ID:Vinna,项目名称:DeepInSummer,代码行数:13,代码来源:MainMenuNavigationProvider.cs

示例4: GetNavigation

        public void GetNavigation(NavigationBuilder builder) {
            builder
                .Add(T("Media"), "6", menu => menu
                    .Add(T("Microsoft Azure Media Jobs"), "10.0", item => item.Action("Index", "Job", new { area = "Orchard.Azure.MediaServices" })
                        .Permission(Permissions.ManageCloudMediaJobs)));

            builder
                .Add(T("Settings"), menu => menu
                    .Add(T("Microsoft Azure Media"), "10.0", item => item.Action("Index", "Settings", new { area = "Orchard.Azure.MediaServices" })
                        .Permission(StandardPermissions.SiteOwner)
                        .Permission(Permissions.ManageCloudMediaSettings)
                ));
        }
开发者ID:SunRobin2015,项目名称:RobinWithOrchard,代码行数:13,代码来源:AdminMenu.cs

示例5: 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

示例6: GetNavigation

 public void GetNavigation(NavigationBuilder builder) {
     builder
         .Add(T("Settings"), menu => menu
             .Add(T("Transliteration"), "10.0", subMenu => subMenu.Action("Index", "TransliterationAdmin", new { area = "Orchard.Localization" })
                 .Add(T("Settings"), "10.0", item => item.Action("Index", "TransliterationAdmin", new { area = "Orchard.Localization" }).LocalNav())
             ));
 }
开发者ID:RasterImage,项目名称:Orchard,代码行数:7,代码来源:AdminMenu.cs

示例7: GetNavigation

 public void GetNavigation(NavigationBuilder builder) {
     builder.Add(T("Workflows"), "10",
         menu => menu
             .Add(T("Workflows"), "1.0",
                 qi => qi.Action("Index", "Admin", new { area = "Orchard.Workflows" }).Permission(StandardPermissions.SiteOwner).LocalNav())
     );
 }
开发者ID:bigfont,项目名称:CertifiedOverheadCrane,代码行数:7,代码来源:AdminMenu.cs

示例8: GetNavigation

 public void GetNavigation(NavigationBuilder builder)
 {
     builder
         .Add(T("Modules"), menu => menu
             .Add(T("Module Profiles"), "4", item => item.Action("Index", "ModuleProfilesAdmin", new { Area = "OrchardHUN.ModuleProfiles" }).LocalNav())
     );
 }
开发者ID:Lombiq,项目名称:Orchard-Module-Profiles,代码行数:7,代码来源:AdminMenu.cs

示例9: 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

示例10: GetNavigation

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

示例11: GetNavigation

 public void GetNavigation(NavigationBuilder builder)
 {
     builder.Add(T("Content"),
                 menu => menu
                             .Add(T("Content Types"), "3", item => item.Action("Index", "Admin", new {area = "Orchard.ContentTypes"}).LocalNav())
                             .Add(T("Content Parts"), "4", item => item.Action("ListParts", "Admin", new {area = "Orchard.ContentTypes"}).LocalNav()));
 }
开发者ID:CAAFA,项目名称:caafa_internet,代码行数:7,代码来源:AdminMenu.cs

示例12: GetNavigation

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

示例13: 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

示例14: GetNavigation

 public void GetNavigation(NavigationBuilder builder) {
     builder
         .Add(T("Migrate to 1.4"), "0", menu => menu.Action("Index", "Route", new { area = "UpgradeTo14" })
             .Add(T("Migrate Routes"), "0", item => item.Action("Index", "Route", new { area = "UpgradeTo14" }).LocalNav().Permission(StandardPermissions.SiteOwner))
             .Add(T("Migrate Fields"), "0", item => item.Action("Index", "Field", new { area = "UpgradeTo14" }).LocalNav().Permission(StandardPermissions.SiteOwner))
         );
 }
开发者ID:Vinna,项目名称:DeepInSummer,代码行数:7,代码来源:AdminMenu.cs

示例15: GetNavigation

        public void GetNavigation(NavigationBuilder builder) {
            builder.Add(T("Taxonomies"), "4",
                        menu => menu
                                    .Add(T("Manage Taxonomies"), "1.0", item => item.Action("Index", "TaxonomyAdmin", new { area = "Summit.Core" }).Permission(Permissions.ManageTaxonomies))
                                    );

            builder.AddImageSet("summit")
                .Add(T("Summit"), "1.5", BuildMenu);

            builder
         .Add(T("Settings"), menu => menu
             .Add(T("Image Power Tools"), "1.0", x => x
                 .Add(T("Settings"), "1.0", a => a.Action("Settings", "Admin", new { area = "Summit.Core" }).Permission(StandardPermissions.SiteOwner).LocalNav())
                 .Add(T("Cache"), "2.0", a => a.Action("Cache", "Admin", new { area = "Summit.Core" }).Permission(StandardPermissions.SiteOwner).LocalNav())
             ));
        }
开发者ID:ThinkPublishing,项目名称:Summit.Core,代码行数:16,代码来源:AdminMenu.cs


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