本文整理汇总了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));
}
}
}
示例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" }));
}
示例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));
}
}
}
示例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)
));
}
示例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)));
}
示例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())
));
}
示例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())
);
}
示例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())
);
}
示例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())
));
}
示例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))
);
}
示例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()));
}
示例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))
);
}
示例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)));
}
示例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))
);
}
示例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())
));
}