Ejemplo n.º 1
0
        protected override void OnStart(TextWriter writer)
        {
            // Create the list item wrapper
            _listItem = GetHelper().Element("li").Component;
            if (Active)
            {
                _listItem.AddCss(Css.Active);
            }
            if (Disabled)
            {
                _listItem.AddCss(Css.Disabled);
            }
            _listItem.Start(writer);

            base.OnStart(writer);
        }
Ejemplo n.º 2
0
        protected override void OnStart(TextWriter writer)
        {
            _listItem = GetHelper().Element("li").Component;
            _listItem.MergeAttribute("role", "presentation");
            if(Disabled)
            {
                _listItem.AddCss(Css.Disabled);
            }
            if (Active)
            {
                _listItem.AddCss(Css.Active);
            }
            _listItem.Start(writer);

            base.OnStart(writer);
        }
Ejemplo n.º 3
0
        protected override void OnStart(TextWriter writer)
        {
            // Change to a div if no link was provided, otherwise wrap in a div
            string href = GetAttribute("href");
            if (string.IsNullOrWhiteSpace(href))
            {
                TagName = "div";
            }
            else
            {
                // Copy media CSS classes to the wrapping div
                _wrapper = GetHelper().Div().Component;
                foreach(string mediaClass in CssClasses.Where(x => x.StartsWith("media-")).ToList())
                {
                    _wrapper.AddCss(mediaClass);
                    CssClasses.Remove(mediaClass);
                }
                _wrapper.Start(writer);
            }

            base.OnStart(writer);

            _image = GetHelper().Image(Src, Alt).AddCss(Css.MediaObject).Component;
            _image.Start(writer);
        }
Ejemplo n.º 4
0
        protected override void OnStart(TextWriter writer)
        {
            // Create the list item wrapper
            _listItem = this.GetHelper().Element("li").Component;
            if (Active)
            {
                _listItem.AddCss(Css.Active);
            }
            _listItem.Start(writer);

            base.OnStart(Active ? new SuppressOutputWriter() : writer);
        }
Ejemplo n.º 5
0
        protected override void OnStart(TextWriter writer)
        {
            // Check if we're in a navbar, and if so, make sure we're in a navbar nav
            if (GetComponent<Navbar>() != null && GetComponent<NavbarNav>() == null)
            {
                GetHelper().NavbarNav().Component.Start(writer);
            }

            // Create the list item wrapper
            _listItem = GetHelper().Element("li").Component;
            if (Active)
            {
                _listItem.AddCss(Css.Active);
            }
            if (Disabled)
            {
                _listItem.AddCss(Css.Disabled);
            }
            _listItem.Start(writer);

            base.OnStart(writer);
        }