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

SurroundLine() public method

public SurroundLine ( string tagName ) : IDisposable
tagName string
return IDisposable
        public IDisposable SurroundLine(string tagName)
        {
            return SurroundLine(new HtmlTag(tagName));
        }

Same methods

HtmlStringBuilder::SurroundLine ( HtmlTag div ) : 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