remove ".Add*" and debugs
This commit is contained in:
@@ -58,16 +58,16 @@ internal sealed class TextBuilder : ParagraphBuilderBase, IText
|
||||
private readonly List<Paragraph> _paragraphs = [];
|
||||
public List<Paragraph> Build() => _paragraphs;
|
||||
|
||||
IText IText.AddFormula(Action<IFormula> configure)
|
||||
IText IText.Formula(Action<IFormula> configure)
|
||||
{
|
||||
var paraBuilder = ParagraphBuilder;
|
||||
paraBuilder.AddFormula(configure);
|
||||
paraBuilder.Formula(configure);
|
||||
_paragraphs.Add(paraBuilder.Build());
|
||||
return this;
|
||||
}
|
||||
|
||||
// Добавление параграфов
|
||||
public IText AddParagraph(Action<IParagraph> configure)
|
||||
public IText Paragraph(Action<IParagraph> configure)
|
||||
{
|
||||
var paraBuilder = ParagraphBuilder;
|
||||
configure(paraBuilder);
|
||||
@@ -75,33 +75,33 @@ internal sealed class TextBuilder : ParagraphBuilderBase, IText
|
||||
return this;
|
||||
}
|
||||
|
||||
public IText AddParagraph(string text, FontProps? font = null)
|
||||
public IText Paragraph(string text, FontProps? font = null)
|
||||
{
|
||||
var paraBuilder = ParagraphBuilder;
|
||||
|
||||
if (font is not null)
|
||||
{
|
||||
paraBuilder.AddRun(text, font);
|
||||
paraBuilder.Run(text, font);
|
||||
}
|
||||
else
|
||||
{
|
||||
paraBuilder.AddRun(text);
|
||||
paraBuilder.Run(text);
|
||||
}
|
||||
|
||||
_paragraphs.Add(paraBuilder.Build());
|
||||
return this;
|
||||
}
|
||||
|
||||
public IText AddParagraph(params string[] lines)
|
||||
public IText Paragraph(params string[] lines)
|
||||
{
|
||||
var paraBuilder = ParagraphBuilder;
|
||||
if (lines.Length > 0)
|
||||
{
|
||||
paraBuilder.AddRun(lines[0]);
|
||||
paraBuilder.Run(lines[0]);
|
||||
for (int i = 1; i < lines.Length; i++)
|
||||
{
|
||||
paraBuilder.Break();
|
||||
paraBuilder.AddRun(lines[i]);
|
||||
paraBuilder.Run(lines[i]);
|
||||
}
|
||||
}
|
||||
_paragraphs.Add(paraBuilder.Build());
|
||||
|
||||
Reference in New Issue
Block a user