Exemplo n.º 1
0
        protected override void WriteHtmlTo(HtmlTextWriter writer)
        {
            var ul = new HtmlElement("ul");

            ul.MergeAttributes(HtmlAttributes);

            foreach (var current in Items)
            {
                CreateMenuNode(current).AppendTo(ul);
            }

            ul.WriteTo(writer);
        }
Exemplo n.º 2
0
        protected override void WriteHtmlTo(HtmlTextWriter writer)
        {
            var ul = new HtmlElement("ul");

            ul.MergeAttributes(HtmlAttributes);

            for (var current = System.Web.SiteMap.CurrentNode; current != null; current = current.ParentNode)
            {
                CreateBreadcrumpNode(current, element => false).PrependTo(ul);
            }

            CreateBreadcrumpNode(LastNode(), element => true).AppendTo(ul);

            ul.WriteTo(writer);
        }
Exemplo n.º 3
0
        public void Should_output_template()
        {
            Mock<TextWriter> output = new Mock<TextWriter>();
            output.Setup(w => w.Write("Template")).Verifiable();

            IHtmlNode tag = new HtmlElement("div");
            tag.Template((writer) => output.Object.Write("Template"));

            tag.WriteTo(output.Object);

            output.VerifyAll();
        }
Exemplo n.º 4
0
        public void Should_write_to_text_writer()
        {
            Mock<TextWriter> output = new Mock<TextWriter>();
            output.Setup(w => w.Write("<div>")).Verifiable();
            output.Setup(w => w.Write("</div>")).Verifiable();

            IHtmlNode tag = new HtmlElement("div");
            tag.WriteTo(output.Object);

            output.VerifyAll();
        }
Exemplo n.º 5
0
        public void Should_write_self_closing_tags_to_text_writer()
        {
            Mock<TextWriter> output = new Mock<TextWriter>();
            output.Setup(w => w.Write("<input />")).Verifiable();

            IHtmlNode tag = new HtmlElement("input", TagRenderMode.SelfClosing);

            tag.WriteTo(output.Object);

            output.VerifyAll();
        }