Beispiel #1
0
 private static string GenerateSubMenuItem(MenuItem item)
 {
     return(item.IsDivider ? ListItemBuilder.DividerItem() : ListItemBuilder.MenuItem(item));
 }
Beispiel #2
0
        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());
        }