Ejemplo n.º 1
0
 public OrchardTagBuilder Create(dynamic shape, string tagName) {
     var tagBuilder = new OrchardTagBuilder(tagName);
     tagBuilder.MergeAttributes(shape.Attributes, false);
     foreach (var cssClass in shape.Classes ?? Enumerable.Empty<string>())
         tagBuilder.AddCssClass(cssClass);
     if (!string.IsNullOrEmpty(shape.Id))
         tagBuilder.GenerateId(shape.Id);
     return tagBuilder;
 }
Ejemplo n.º 2
0
 public OrchardTagBuilder Create(dynamic shape, string tagName) {
     // Identical to supressed version except following line looks for a tag name in the shape:
     var tagBuilder = new OrchardTagBuilder(shape.TagName==null ? tagName : (string)shape.TagName);
     tagBuilder.MergeAttributes(shape.Attributes, false);
     foreach (var cssClass in shape.Classes ?? Enumerable.Empty<string>())
         tagBuilder.AddCssClass(cssClass);
     if (!string.IsNullOrEmpty(shape.Id))
         tagBuilder.GenerateId(shape.Id);
     return tagBuilder;
 }
Ejemplo n.º 3
0
        public OrchardTagBuilder Create(dynamic shape, string tagName)
        {
            var tagBuilder = new OrchardTagBuilder(tagName);

            tagBuilder.MergeAttributes(shape.Attributes, false);
            foreach (var cssClass in shape.Classes ?? Enumerable.Empty <string>())
            {
                tagBuilder.AddCssClass(cssClass);
            }
            if (!string.IsNullOrEmpty(shape.Id))
            {
                tagBuilder.GenerateId(shape.Id);
            }
            return(tagBuilder);
        }