-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtil.cs
More file actions
43 lines (38 loc) · 953 Bytes
/
Copy pathUtil.cs
File metadata and controls
43 lines (38 loc) · 953 Bytes
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
namespace LesserKnown.NET;
public static class Util
{
private static void PrintWithPadding(string demoString)
{
int chars = (Console.WindowWidth - demoString.Length) / 2;
string padding = new string('-', chars);
Console.WriteLine(padding + demoString + padding);
}
public static void PrintDemoStart(string demoName)
{
string demoString = $" {demoName} START ";
PrintWithPadding(demoString);
}
public static void PrintDemoEnd(string demoName)
{
string demoString = $" {demoName} END ";
PrintWithPadding(demoString);
Console.WriteLine();
}
}
public class MainDemo
{
public string DemoName { get; set; }
public MainDemo()
{
DemoName = GetType().Name;
Util.PrintDemoStart(DemoName);
}
public void EndDemo()
{
Util.PrintDemoEnd(DemoName);
}
public void Run()
{
EndDemo();
}
}