-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPrinterAscii.cs
68 lines (51 loc) · 1.66 KB
/
PrinterAscii.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System;
using System.Threading;
using Figgle;
using Spectre.Console;
namespace FizzBuzzAscii
{
public class PrinterAscii : IPrintOutput
{
public int Speed { get; set; } = 100;
public PrinterAscii(int Speed)
{
this.Speed = Speed;
}
public void Print(string value, string style)
{
AnsiConsole.Markup($"{style}{FiggleFonts.Standard.Render(value)}[/]");
Thread.Sleep(Speed);
}
public void Info(string value)
{
AnsiConsole.Markup($"[underline deepskyblue1]{value}[/] ");
Thread.Sleep(Speed);
}
public void GoodBye(string message)
{
var panel = new Panel($"[bold lime]{FiggleFonts.Standard.Render(message)}[/]");
panel.Border = BoxBorder.Double;
AnsiConsole.Render(panel);
AnsiConsole.Markup("[red]Press ENTER to exit[/]");
Console.ReadLine();
}
public void SimilateWork()
{
AnsiConsole.Status()
.Spinner(Spinner.Known.Aesthetic)
.SpinnerStyle(Style.Parse("green bold"))
.Start("Loading...", ctx =>
{
Thread.Sleep(1000);
AnsiConsole.MarkupLine("Doing some work...");
Thread.Sleep(1000);
AnsiConsole.MarkupLine("Loading FizzBuzz algorithm...");
Thread.Sleep(2000);
AnsiConsole.MarkupLine("Loading Objets...");
Thread.Sleep(2000);
AnsiConsole.MarkupLine("Loading Styles...");
Thread.Sleep(2000);
});
}
}
}