mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 08:52:50 +08:00

Closes #85 * Split Border into BoxBorder and TableBorder * Change how different table parts are composed * Add markdown table border
28 lines
830 B
C#
28 lines
830 B
C#
using System;
|
|
|
|
namespace Spectre.Console.Rendering
|
|
{
|
|
/// <summary>
|
|
/// Represents a square border.
|
|
/// </summary>
|
|
public sealed class SquareBoxBorder : BoxBorder
|
|
{
|
|
/// <inheritdoc/>
|
|
protected override string GetBorderPart(BoxBorderPart part)
|
|
{
|
|
return part switch
|
|
{
|
|
BoxBorderPart.TopLeft => "┌",
|
|
BoxBorderPart.Top => "─",
|
|
BoxBorderPart.TopRight => "┐",
|
|
BoxBorderPart.Left => "│",
|
|
BoxBorderPart.Right => "│",
|
|
BoxBorderPart.BottomLeft => "└",
|
|
BoxBorderPart.Bottom => "─",
|
|
BoxBorderPart.BottomRight => "┘",
|
|
_ => throw new InvalidOperationException("Unknown border part."),
|
|
};
|
|
}
|
|
}
|
|
}
|