add text Separator in TextBlock and TextLine

This commit is contained in:
BobLd
2020-05-23 19:39:23 +01:00
committed by Eliot Jones
parent 5f75205e41
commit bb94348127
2 changed files with 20 additions and 4 deletions

View File

@@ -11,6 +11,11 @@
/// </summary>
public class TextBlock
{
/// <summary>
/// The separator used between lines in the block.
/// </summary>
public readonly string Separator;
/// <summary>
/// The text of the block.
/// </summary>
@@ -39,8 +44,9 @@
/// <summary>
/// Create a new <see cref="TextBlock"/>.
/// </summary>
/// <param name="lines"></param>
public TextBlock(IReadOnlyList<TextLine> lines)
/// <param name="lines">The words contained in the line, in the correct order.</param>
/// <param name="separator">The separator used between lines in the block.</param>
public TextBlock(IReadOnlyList<TextLine> lines, string separator = "\n")
{
if (lines == null)
{
@@ -52,6 +58,8 @@
throw new ArgumentException("Empty lines provided.", nameof(lines));
}
Separator = separator;
ReadingOrder = -1;
TextLines = lines;