mirror of
https://github.com/spectreconsole/spectre.console.git
synced 2025-12-26 15:57:58 +01:00
25 lines
703 B
C#
25 lines
703 B
C#
using System;
|
|
|
|
namespace Spectre.Console.Rendering
|
|
{
|
|
/// <summary>
|
|
/// An ASCII rendering of a tree.
|
|
/// </summary>
|
|
public sealed class AsciiTreeAppearance : TreeAppearance
|
|
{
|
|
/// <inheritdoc/>
|
|
public override int PartSize => 4;
|
|
|
|
/// <inheritdoc/>
|
|
public override string GetPart(TreePart part)
|
|
{
|
|
return part switch
|
|
{
|
|
TreePart.SiblingConnector => "│ ",
|
|
TreePart.ChildBranch => "├── ",
|
|
TreePart.BottomChildBranch => "└── ",
|
|
_ => throw new ArgumentOutOfRangeException(nameof(part), part, "Unknown tree part."),
|
|
};
|
|
}
|
|
}
|
|
} |