mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Clear lines on certain console printouts.
This commit is contained in:
@@ -45,12 +45,14 @@ namespace DiscImageChef
|
||||
|
||||
internal static void UpdateProgress(string text, long current, long maximum)
|
||||
{
|
||||
DicConsole.Write("\r" + text);
|
||||
ClearCurrentConsoleLine();
|
||||
DicConsole.Write(text);
|
||||
}
|
||||
|
||||
internal static void PulseProgress(string text)
|
||||
{
|
||||
DicConsole.Write("\r" + text);
|
||||
ClearCurrentConsoleLine();
|
||||
DicConsole.Write(text);
|
||||
}
|
||||
|
||||
internal static void InitProgress2() { }
|
||||
@@ -62,7 +64,8 @@ namespace DiscImageChef
|
||||
|
||||
internal static void UpdateProgress2(string text, long current, long maximum)
|
||||
{
|
||||
DicConsole.Write("\r" + text);
|
||||
ClearCurrentConsoleLine();
|
||||
DicConsole.Write(text);
|
||||
}
|
||||
|
||||
internal static void InitTwoProgress() { }
|
||||
@@ -75,11 +78,13 @@ namespace DiscImageChef
|
||||
internal static void UpdateTwoProgress(string text, long current, long maximum, string text2, long current2,
|
||||
long maximum2)
|
||||
{
|
||||
DicConsole.Write("\r" + text + ": " + text2);
|
||||
ClearCurrentConsoleLine();
|
||||
DicConsole.Write(text + ": " + text2);
|
||||
}
|
||||
|
||||
internal static void UpdateStatus(string text)
|
||||
{
|
||||
ClearCurrentConsoleLine();
|
||||
DicConsole.WriteLine(text);
|
||||
}
|
||||
|
||||
@@ -87,5 +92,13 @@ namespace DiscImageChef
|
||||
{
|
||||
DicConsole.ErrorWriteLine(text);
|
||||
}
|
||||
|
||||
static void ClearCurrentConsoleLine()
|
||||
{
|
||||
int currentLineCursor = System.Console.CursorTop;
|
||||
System.Console.SetCursorPosition(0, System.Console.CursorTop);
|
||||
System.Console.Write(new string(' ', System.Console.WindowWidth));
|
||||
System.Console.SetCursorPosition(0, currentLineCursor);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user