Esempio n. 1
0
        /// <summary>
        ///   Constructor
        /// </summary>
        /// <param name="type">Navigation bar type</param>
        /// <param name="items">Navigation bar items</param>
        public BootstrapNavBar(EBootstrapNavbar type, params Hyperlink[] items)
            : this(type)
        {
            HtmlList list = new HtmlList(EList.Unordered);
            foreach (Hyperlink item in items)
            {
                if (item.CssClasses.Contains("brand") || item.CssClasses.Contains("navbar-brand"))
                {
                    Brand = item;
                }
                else
                {
                    HtmlListItem li = new HtmlListItem(string.Empty);
                    li.AppendTags.Add(item.Component);
                    list.AppendTags.Add(li);
                }
            }

            CreateNavBar(list);
        }
 /// <summary>
 ///   Create a navigation bar
 /// </summary>
 /// <param name="html">Current HTML helper object</param>
 /// <param name="type">Navigation bar type</param>
 /// <param name="items">Navigation bar items</param>
 /// <returns>A navigation bar</returns>
 public static BootstrapNavBar Navbar(this HtmlHelper html, EBootstrapNavbar type, params Hyperlink[] items)
 {
     return(new BootstrapNavBar(type, items));
 }
 /// <summary>
 ///   Create a navigation bar
 /// </summary>
 /// <param name="html">Current HTML helper object</param>
 /// <param name="type">Navigation bar type</param>
 /// <param name="items">Navigation bar items</param>
 /// <returns>A navigation bar</returns>
 public static BootstrapNavBar Navbar(this HtmlHelper html, EBootstrapNavbar type, HtmlList items)
 {
     return(new BootstrapNavBar(type, items));
 }
Esempio n. 4
0
 /// <summary>
 ///   Constructor
 /// </summary>
 /// <param name="type">Navigation bar type</param>
 /// <param name="brandLink">Navigation bar brand link</param>
 /// <param name="items">Navigation bar items</param>
 public BootstrapNavBar(EBootstrapNavbar type, Hyperlink brandLink, HtmlList items)
     : this(type)
 {
     Brand = brandLink;
     CreateNavBar(items);
 }
Esempio n. 5
0
 /// <summary>
 ///   Constructor
 /// </summary>
 /// <param name="type">Navigation bar type</param>
 /// <param name="items">Navigation bar items</param>
 public BootstrapNavBar(EBootstrapNavbar type, HtmlList items)
     : this(type)
 {
     CreateNavBar(items);
 }
Esempio n. 6
0
 /// <summary>
 ///   Default constructor
 /// </summary>
 /// <param name="type">Navigation bar type</param>
 private BootstrapNavBar(EBootstrapNavbar type)
     : base(EHtmlTag.Div)
 {
     Type = type;
 }