// ReSharper disable MemberCanBePrivate.Global // ReSharper disable AutoPropertyCanBeMadeGetOnly.Global using NSExt.Extensions; using Spectre.Console.Rendering; namespace Dot.Time; internal sealed class TaskStatusColumn : ProgressColumn { public enum Statues : byte { /// /// Ready /// [Description($"[gray]{nameof(Ready)}[/]")] Ready , /// /// Connecting /// [Description($"[yellow]{nameof(Connecting)}[/]")] Connecting , /// /// Succeed /// [Description($"[green]{nameof(Succeed)}[/]")] Succeed , /// /// Failed /// [Description($"[red]{nameof(Failed)}[/]")] Failed } /// /// Gets or sets the alignment of the task description. /// /// /// The alignment of the task description. /// public Justify Alignment { get; set; } = Justify.Right; /// public override IRenderable Render(RenderOptions options, ProgressTask task, TimeSpan deltaTime) { var text = task.State.Get(nameof(TaskStatusColumn)); return new Markup(text.Desc()).Overflow(Overflow.Ellipsis).Justify(Alignment); } }