mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-14 15:53:30 -07:00
28 lines
666 B
C#
28 lines
666 B
C#
using System;
|
|
|
|
namespace DiscordChatExporter.Cli.Internal
|
|
{
|
|
internal class InlineProgress : IProgress<double>, IDisposable
|
|
{
|
|
private readonly int _posX;
|
|
private readonly int _posY;
|
|
|
|
public InlineProgress()
|
|
{
|
|
_posX = Console.CursorLeft;
|
|
_posY = Console.CursorTop;
|
|
}
|
|
|
|
public void Report(double progress)
|
|
{
|
|
Console.SetCursorPosition(_posX, _posY);
|
|
Console.WriteLine($"{progress:P1}");
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
Console.SetCursorPosition(_posX, _posY);
|
|
Console.WriteLine("Completed ✓");
|
|
}
|
|
}
|
|
} |