private static string GenerateSubMenuItem(MenuItem item) { return(item.IsDivider ? ListItemBuilder.DividerItem() : ListItemBuilder.MenuItem(item)); }
public static String Nav(IEnumerable <MenuItem> items) { var builder = new StringBuilder(); builder.Append(@"<ul class=""nav navbar-nav"">"); foreach (var menuItem in items.Where(menuItem => !menuItem.IsDivider)) { builder.Append(menuItem.Submenus.Any() ? DropDownItemBuilder.MenuItem(menuItem) : ListItemBuilder.MenuItem(menuItem)); } builder.Append("</ul>"); return(builder.ToString()); }