mirror of
https://github.com/stokebob/bnhtrade.git
synced 2026-03-19 06:27:15 +00:00
36 lines
1.1 KiB
C#
36 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace bnhtrade.Core.UI.Console
|
|
{
|
|
public class Update
|
|
{
|
|
public void WriteLine(string consoleText, Boolean newLine = true)
|
|
{
|
|
if (newLine)
|
|
{
|
|
System.Console.WriteLine("\r[" + DateTime.Now.ToString("HH:mm:ss") + "] " + consoleText);
|
|
}
|
|
else
|
|
{
|
|
System.Console.Write("\r[" + DateTime.Now.ToString("HH:mm:ss") + "] " + consoleText);
|
|
}
|
|
}
|
|
public void Wait(string consoleMessage, int waitSeconds)
|
|
{
|
|
do
|
|
{
|
|
System.Console.Write("\r[--------] " + consoleMessage, string. Format("{0:00}", waitSeconds));
|
|
System.Threading.Thread.Sleep(1000);
|
|
waitSeconds = waitSeconds - 1;
|
|
} while (waitSeconds > 0);
|
|
System.Console.Write("\r");
|
|
System.Console.Write(new String(' ', System.Console.BufferWidth - 1));
|
|
System.Console.Write("\r");
|
|
}
|
|
}
|
|
}
|