remove ".Add*" and debugs

This commit is contained in:
melekhin
2026-09-02 16:42:34 +07:00
parent e5d291713a
commit da68c0754b
6 changed files with 87 additions and 87 deletions
@@ -40,7 +40,7 @@ internal sealed class TableBuilder : ParagraphBuilderBase, ITable, IRow, ICell
}
// Добавление строк с использованием IRowBuilder
public ITable AddRow(Action<IRow> configure)
public ITable Row(Action<IRow> configure)
{
var IRowBuilder = RowBuilder;
configure(this);
@@ -48,7 +48,7 @@ internal sealed class TableBuilder : ParagraphBuilderBase, ITable, IRow, ICell
return this;
}
public ITable AddRow(double height, Action<IRow> configure)
public ITable Row(double height, Action<IRow> configure)
{
var IRowBuilder = RowBuilder.SetHeight(height);
configure(this);
@@ -57,25 +57,25 @@ internal sealed class TableBuilder : ParagraphBuilderBase, ITable, IRow, ICell
}
// Быстрые методы для добавления строк с ячейками
public ITable AddRowWithCells(params string[] cellTexts)
public ITable RowWithCells(params string[] cellTexts)
{
AddRow(row =>
Row(row =>
{
foreach (var text in cellTexts)
{
row.AddCell(text);
row.Cell(text);
}
});
return this;
}
public ITable AddRowWithCells(FontProps font, params string[] cellTexts)
public ITable RowWithCells(FontProps font, params string[] cellTexts)
{
AddRow(row =>
Row(row =>
{
foreach (var text in cellTexts)
{
row.AddCell(text, font);
row.Cell(text, font);
}
});
return this;
@@ -155,7 +155,7 @@ internal sealed class TableBuilder : ParagraphBuilderBase, ITable, IRow, ICell
}
// Добавление ячеек
public IRow AddCell(Action<ICell> configure)
public IRow Cell(Action<ICell> configure)
{
var cellBuilder = CellBuilder;
configure(this);
@@ -163,47 +163,47 @@ internal sealed class TableBuilder : ParagraphBuilderBase, ITable, IRow, ICell
return this;
}
public IRow AddCell(string text)
public IRow Cell(string text)
{
var cellBuilder = CellBuilder;
cellBuilder.AddParagraph(p => p.AddRun(text));
cellBuilder.Paragraph(p => p.Run(text));
_row.AppendChild(cellBuilder.Build());
return this;
}
public IRow AddCell(string text, FontProps font)
public IRow Cell(string text, FontProps font)
{
var cellBuilder = CellBuilder;
if (font is not null)
cellBuilder.AddParagraph(p => p.AddRun(text, font));
else cellBuilder.AddParagraph(p => p.AddRun(text));
cellBuilder.Paragraph(p => p.Run(text, font));
else cellBuilder.Paragraph(p => p.Run(text));
_row.AppendChild(cellBuilder.Build());
return this;
}
public IRow AddCell(CellProps cellProps, string text, FontProps font)
public IRow Cell(CellProps cellProps, string text, FontProps font)
{
var cellBuilder = CellBuilder.SetCellProps(cellProps);
if (font is not null)
cellBuilder.AddParagraph(p => p.AddRun(text, font));
else cellBuilder.AddParagraph(p => p.AddRun(text));
cellBuilder.Paragraph(p => p.Run(text, font));
else cellBuilder.Paragraph(p => p.Run(text));
_row.AppendChild(cellBuilder.Build());
return this;
}
public IRow AddCell(CellProps cellProps, string text)
public IRow Cell(CellProps cellProps, string text)
{
var cellBuilder = CellBuilder.SetCellProps(cellProps);
cellBuilder.AddParagraph(p => p.AddRun(text));
cellBuilder.Paragraph(p => p.Run(text));
_row.AppendChild(cellBuilder.Build());
return this;
}
public IRow AddCell(CellProps cellProps)
public IRow Cell(CellProps cellProps)
{
var cellBuilder = CellBuilder.SetCellProps(cellProps);
_row.AppendChild(cellBuilder.Build());
@@ -219,17 +219,17 @@ internal sealed class TableBuilder : ParagraphBuilderBase, ITable, IRow, ICell
}
public IRow AddCellWithPara(Action<IParagraph> configure)
public IRow CellWithPara(Action<IParagraph> configure)
{
var cellBuilder = CellBuilder;
cellBuilder.AddParagraph(configure);
cellBuilder.Paragraph(configure);
_row.AppendChild(cellBuilder.Build());
return this;
}
public IRow AddCellWithPara(CellProps cellProps, Action<IParagraph> configure)
public IRow CellWithPara(CellProps cellProps, Action<IParagraph> configure)
{
var cellBuilder = CellBuilder.SetCellProps(cellProps);
cellBuilder.AddParagraph(configure);
cellBuilder.Paragraph(configure);
_row.AppendChild(cellBuilder.Build());
return this;
}
@@ -276,7 +276,7 @@ internal sealed class TableBuilder : ParagraphBuilderBase, ITable, IRow, ICell
}
// Добавление параграфов
public ICell AddParagraph(Action<IParagraph> configure)
public ICell Paragraph(Action<IParagraph> configure)
{
var paraBuilder = ParagraphBuilder;
configure(paraBuilder);
@@ -284,44 +284,44 @@ internal sealed class TableBuilder : ParagraphBuilderBase, ITable, IRow, ICell
return this;
}
public ICell AddParagraph(string text, FontProps? font = null)
public ICell 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 ICell AddParagraph(params string[] lines)
public ICell 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());
return this;
}
// Метод AddFormula для ICellBuilder
ICell ICell.AddFormula(Action<IFormula> configure)
// Метод Formula для ICellBuilder
ICell ICell.Formula(Action<IFormula> configure)
{
var paraBuilder = ParagraphBuilder;
paraBuilder.AddFormula(configure);
paraBuilder.Formula(configure);
_paragraphs.Add(paraBuilder.Build());
return this;
}