Signum.Web.HtmlStringBuilder.SurroundLine C# (CSharp) Method

SurroundLine() public method

public SurroundLine ( HtmlTag div ) : IDisposable
div HtmlTag
return IDisposable
        public IDisposable SurroundLine(HtmlTag div)
        {
            AddLine(div.ToHtml(TagRenderMode.StartTag));

            return new Disposable(() => AddLine(div.ToHtml(TagRenderMode.EndTag)));
        }

Same methods

HtmlStringBuilder::SurroundLine ( string tagName ) : IDisposable

Usage Example

Ejemplo n.º 1
0
        public static MvcHtmlString TimePicker(this HtmlHelper helper, string name, bool formGroup, string value, string dateFormat, IDictionary <string, object> htmlProps = null)
        {
            if (dateFormat.Contains("f") || dateFormat.Contains("F"))
            {
                htmlProps["class"] += " form-control";
                return(helper.TextBox(TypeContextUtilities.Compose(name, "Time"), value, htmlProps));
            }

            var input = new HtmlTag("input")
                        .IdName(name)
                        .Attr("type", "text")
                        .Class("form-control")
                        .Attrs(htmlProps)
                        .Attr("value", value);

            if (!formGroup)
            {
                return(AttachTimePiceker(input, dateFormat));
            }

            HtmlStringBuilder sb = new HtmlStringBuilder();

            using (sb.SurroundLine(AttachTimePiceker(new HtmlTag("div").Class("input-group time"), dateFormat)))
            {
                sb.Add(input);

                using (sb.SurroundLine(new HtmlTag("span").Class("input-group-addon")))
                    sb.Add(new HtmlTag("span").Class("glyphicon glyphicon-time"));
            }

            return(sb.ToHtml());
        }
All Usage Examples Of Signum.Web.HtmlStringBuilder::SurroundLine