예제 #1
0
        private static IEnumerable <string> Format(PageContentRowFormattingStyle style,
                                                   IEnumerable <IReadOnlyList <string> > values, IReadOnlyList <int> columnLengths)
        {
            foreach (var row in values)
            {
                var stringBuilder = new StringBuilder();

                switch (style)
                {
                case PageContentRowFormattingStyle.Indent:
                    stringBuilder.Append(' ', IndentSize);

                    break;
                }

                for (var i = 0; i < row.Count; i++)
                {
                    if (i == row.Count - 1)
                    {
                        stringBuilder.Append(row[i]);

                        continue;
                    }

                    stringBuilder.AppendFormat($"{{0,{columnLengths[i] * -1}}}", row[i]);
                }

                yield return(stringBuilder.ToString());
            }
        }
예제 #2
0
 public void AppendText(PageContentRowFormattingStyle style,
                        params string[] contents)
 {
     foreach (var content in contents)
     {
         _contents.Add(new PageContent {
             ColumnSize = 1,
             Style      = style,
             Values     = new[] {
                 new[] {
                     content
                 }
             }
         });
     }
 }
예제 #3
0
 public void AppendTable(PageContentRowFormattingStyle style,
                         (string, string) columns,