Example #1
0
 public static void AddClientValidationAttributes(this TomeltTagBuilder tagBuilder, IDictionary <string, string> clientAttributes)
 {
     foreach (var attribute in clientAttributes)
     {
         tagBuilder.Attributes[attribute.Key] = attribute.Value;
     }
 }
Example #2
0
        public static TomeltTagBuilder AddCommonElementAttributes(this TomeltTagBuilder tagBuilder, dynamic shape)
        {
            var attributes = GetCommonElementAttributes(shape);

            tagBuilder.MergeAttributes(shape.Attributes);
            tagBuilder.MergeAttributes(attributes);
            return(tagBuilder);
        }
Example #3
0
        public void Form(HtmlHelper Html, Action <object> Output, dynamic Display, dynamic Shape, string Method, string Action)
        {
            // (todo) design markup
            TomeltTagBuilder tag = _tagBuilderFactory.Create(Shape, "form");

            tag.MergeAttribute("action", Action ?? Html.ViewContext.HttpContext.Request.Url.PathAndQuery);
            tag.MergeAttribute("method", Method ?? "POST");

            Output(tag.ToString(TagRenderMode.StartTag));
            foreach (var item in Ordered(Shape.Items))
            {
                Output(Display(item));
            }
            Output(tag.ToString(TagRenderMode.EndTag));
        }
Example #4
0
        public void Fieldset(Action <object> Output, dynamic Display, dynamic Shape, object Title)
        {
            // (todo) design markup
            TomeltTagBuilder tag = _tagBuilderFactory.Create(Shape, "fieldset");

            Output(tag.ToString(TagRenderMode.StartTag));
            if (Title != null)
            {
                Output("<legend>");
                Output(Display(Title));
                Output("</legend>");
            }
            foreach (var item in Ordered(Shape.Items))
            {
                Output(Display(item));
            }
            Output(tag.ToString(TagRenderMode.EndTag));
        }