示例#1
0
 private static WireframeGenerator BufferH(
     WireframeGenerator gen,
     int level,
     int wordCount         = 2,
     object htmlAttributes = null) => gen.Add(
     WireframeGenerator.GenerateHtmlIpsum($"h{level}", () => Lorem.GenerateWords(wordCount), htmlAttributes)
     );
示例#2
0
        public static WireframeGenerator Table(this WireframeGenerator gen, int rows = 5, object tableAttributes = null)
        {
            A.Configure <IpsumTableModel>()
            .Fill(cfg => cfg.Lorem).AsLoremIpsumWords(2)
            .Fill(cfg => cfg.Ipsum).AsLoremIpsumWords(3)
            .Fill(cfg => cfg.Aliquam).AsLoremIpsumWords(1);
            IList <IpsumTableModel> data = A.ListOf <IpsumTableModel>(rows);

            return(gen.Add(CreateTableHtmlIpsum(data, tableAttributes)));
        }
示例#3
0
        public static WireframeGenerator Image(this WireframeGenerator gen,
                                               int width,
                                               int height,
                                               string text            = null,
                                               string backgroundColor = null,
                                               string textColor       = null,
                                               object htmlAttributes  = null,
                                               ImgFormat format       = ImgFormat.GIF)
        {
            var img = new TagBuilder("img");

            img.TagRenderMode = TagRenderMode.SelfClosing;
            img.Attributes.Add("src", PlaceholditUrlBuilder.UrlFor(width, height, text, backgroundColor, textColor));
            img.MergeAttributes(HtmlAttributeHelper.GetHtmlAttributeDictionaryOrNull(htmlAttributes));
            return(gen.Add(img));
        }
示例#4
0
 /// <summary>
 /// Gets a dl element containing lorem ipsum
 /// </summary>
 /// <example>To create a unordered list of Lorem Ipusm nested in HTML 'dl' tags.<code>@Html.dl()</code></example>
 /// <param name="listCount">Number of list items to create</param>
 /// <param name="wordCount">Number of words to create</param>
 /// <param name="links">List item will contain a link, ex: href="#"</param>
 /// <param name="dlAttributes">dl element attributes</param>
 /// <param name="ddAttributes">dd element attributes</param>
 /// <returns></returns>
 public static WireframeGenerator Dl(this WireframeGenerator gen, int listCount = 5, int wordCount = 2, bool links = false, object dlAttributes = null, object ddAttributes = null) =>
 gen.Add(GenerateListHtmlIpsum("dl", "dd", listCount, links, ddAttributes, wordCount, dlAttributes));
示例#5
0
 /// <summary>
 /// Gets a ol element containing lorem ipsum
 /// </summary>
 /// <example>To create a unordered list of Lorem Ipusm nested in HTML 'ol' tags.<code>@Html.ol()</code></example>
 /// <param name="listCount">Number of list items to create</param>
 /// <param name="wordCount">Number of words to create</param>
 /// <param name="links">List item will contain a link, ex: href="#"</param>
 /// <param name="olAttributes">ol element attributes</param>
 /// <param name="liAttributes">li element attributes</param>
 /// <returns></returns>
 public static WireframeGenerator Ol(this WireframeGenerator gen, int listCount = 5, int wordCount = 2, bool links = false, object olAttributes = null, object liAttributes = null) =>
 gen.Add(GenerateListHtmlIpsum("ol", "li", listCount, links, liAttributes, wordCount, olAttributes));
示例#6
0
 public static WireframeGenerator Table <T>(
     this WireframeGenerator gen,
     int rows = 5, object tableAttributes = null) where T : new() =>
 gen.Add(CreateTableHtmlIpsum(A.ListOf <T>(rows), tableAttributes));