mirror of
https://github.com/spectreconsole/spectre.console.git
synced 2025-10-25 15:19:23 +00:00
38 lines
1.3 KiB
C#
38 lines
1.3 KiB
C#
using System;
|
|
|
|
namespace Spectre.Console.Composition
|
|
{
|
|
/// <summary>
|
|
/// Represents a square border.
|
|
/// </summary>
|
|
public sealed class SquareBorder : Border
|
|
{
|
|
/// <inheritdoc/>
|
|
protected override string GetBoxPart(BorderPart part)
|
|
{
|
|
return part switch
|
|
{
|
|
BorderPart.HeaderTopLeft => "┌",
|
|
BorderPart.HeaderTop => "─",
|
|
BorderPart.HeaderTopSeparator => "┬",
|
|
BorderPart.HeaderTopRight => "┐",
|
|
BorderPart.HeaderLeft => "│",
|
|
BorderPart.HeaderSeparator => "│",
|
|
BorderPart.HeaderRight => "│",
|
|
BorderPart.HeaderBottomLeft => "├",
|
|
BorderPart.HeaderBottom => "─",
|
|
BorderPart.HeaderBottomSeparator => "┼",
|
|
BorderPart.HeaderBottomRight => "┤",
|
|
BorderPart.CellLeft => "│",
|
|
BorderPart.CellSeparator => "│",
|
|
BorderPart.ColumnRight => "│",
|
|
BorderPart.FooterBottomLeft => "└",
|
|
BorderPart.FooterBottom => "─",
|
|
BorderPart.FooterBottomSeparator => "┴",
|
|
BorderPart.FooterBottomRight => "┘",
|
|
_ => throw new InvalidOperationException("Unknown box part."),
|
|
};
|
|
}
|
|
}
|
|
}
|