[SimpleSort, Logger] Even more versitile output

This commit is contained in:
Matt Nadareski
2016-06-28 21:19:12 -07:00
parent 30a2b31f74
commit c41c171b13
2 changed files with 5 additions and 2 deletions

View File

@@ -242,7 +242,10 @@ namespace SabreTools.Helper
{ {
for (int i = line; i < Console.WindowHeight; i++) for (int i = line; i < Console.WindowHeight; i++)
{ {
Log(" ", i, 0); // http://stackoverflow.com/questions/8946808/can-console-clear-be-used-to-only-clear-a-line-instead-of-whole-console
Console.SetCursorPosition(0, Console.CursorTop);
Console.Write(new string(' ', Console.WindowWidth));
Console.SetCursorPosition(0, i);
} }
} }
return true; return true;

View File

@@ -360,7 +360,7 @@ namespace SabreTools
bool success = true; bool success = true;
// Get the full path of the input for movement purposes // Get the full path of the input for movement purposes
string percentage = Math.Round((100 * ((double)index / total)), 2, MidpointRounding.AwayFromZero).ToString(); string percentage = (index == 0 ? "0.00" : Math.Round((100 * ((double)index / total)), 2, MidpointRounding.AwayFromZero).ToString());
string statement = percentage + "% - " + input; string statement = percentage + "% - " + input;
_logger.ClearBeneath(_cursorTop + 1); _logger.ClearBeneath(_cursorTop + 1);
_logger.Log(statement, _cursorTop, 0); _logger.Log(statement, _cursorTop, 0);