mirror of
https://github.com/nsnail/dot.git
synced 2025-06-17 21:13:21 +08:00
24 lines
763 B
C#
24 lines
763 B
C#
// ReSharper disable MemberCanBePrivate.Global
|
|
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global
|
|
|
|
using Spectre.Console.Rendering;
|
|
|
|
namespace Dot.Time;
|
|
|
|
internal sealed class TaskResultColumn : ProgressColumn
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the alignment of the task description.
|
|
/// </summary>
|
|
/// <value>
|
|
/// The alignment of the task description.
|
|
/// </value>
|
|
public Justify Alignment { get; set; } = Justify.Right;
|
|
|
|
/// <inheritdoc />
|
|
public override IRenderable Render(RenderOptions options, ProgressTask task, TimeSpan deltaTime)
|
|
{
|
|
var text = task.State.Get<TimeSpan>(nameof(TaskResultColumn));
|
|
return new Markup(text.ToString()).Overflow(Overflow.Ellipsis).Justify(Alignment);
|
|
}
|
|
} |