Skip to content

Instantly share code, notes, and snippets.

@VladDen4
Created April 6, 2023 20:47
Show Gist options
  • Save VladDen4/b6d301e6a2075f2e906ee5d2711ffb4c to your computer and use it in GitHub Desktop.
Save VladDen4/b6d301e6a2075f2e906ee5d2711ffb4c to your computer and use it in GitHub Desktop.
ColoredConsole package test file
using ColoredConsole;
class Program
{
private static void Main(string[] args)
{
TestColor();
TestSpinner();
TestLoader();
Thread.Sleep(1000);
Writer.Log("Exit . . .");
Console.ReadKey();
}
public static void TestColor()
{
Writer.Log("TODO: fix files on server");
Writer.Log("Initialize colors . . .", LogStatus.Default);
Writer.Log("We have new update. Downloading . . .", LogStatus.Info);
for (byte i = 1; i < 6; i++)
{
Writer.Log($"Download part {i}/5");
Thread.Sleep(200);
}
Writer.Log("All files downloaded. Installing . . .", LogStatus.Success);
Writer.Log("Some troubles found.", LogStatus.Warning);
Writer.Log("Whoops! Error occured. Get some help.", LogStatus.Error);
}
public static void TestSpinner()
{
Spinner spinner = new("Trying to fix");
spinner.Start();
Thread.Sleep(5000);
spinner.Stop(false);
}
public static void TestLoader()
{
Loader loader = new("Downloading");
loader.Start();
for (byte i = 0; i < 51; i++)
{
loader.SetProgress(i);
Thread.Sleep(100);
}
loader.Stop(false);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment