예제 #1
0
        private static HTMLBuilder BuildHTMLPage(IFieldFormatter formatter, string heading)
        {
            var htmlBuilder = new HTMLBuilder();

            BuildHTMLHeader(formatter, heading, htmlBuilder);
            htmlBuilder.AddBodyStart();
            CreateTableEntries(formatter, htmlBuilder);
            htmlBuilder.CloseBody();
            htmlBuilder.CloseHTML();
            return(htmlBuilder);
        }
예제 #2
0
        private static void CreateTableEntries(IFieldFormatter formatter, HTMLBuilder htmlBuilder)
        {
            foreach (var pair in formatter.Values)
            {
                htmlBuilder.AddLineBreak();
                htmlBuilder.AddHeading2($"{pair.Key}");
                htmlBuilder.AddLineBreak();
                htmlBuilder.AddTableHeader(formatter.Headers);
                foreach (var tableValues in pair.Value)
                {
                    htmlBuilder.AddTableValues(tableValues);
                }

                htmlBuilder.CloseTableHeader();
                htmlBuilder.AddLineBreak();
            }
        }
예제 #3
0
 private static void BuildHTMLHeader(IFieldFormatter formatter, string heading, HTMLBuilder htmlBuilder)
 {
     htmlBuilder.AddHeading1(heading);
     htmlBuilder.AddLineBreak().AddLineBreak();
     htmlBuilder.AddHeading2($"Generated on: {formatter.LastUpdatedTime}");
 }