-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathProgram.cs
72 lines (67 loc) · 2.33 KB
/
Program.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
69
70
71
72
using Microsoft.Extensions.Logging;
using System;
using System.Reflection;
namespace DisCatSharp.Support
{
/// <summary>
/// The program.
/// </summary>
public class Program
{
/// <summary>
/// The main entry point.
/// </summary>
public static void Main()
{
// Console.BackgroundColor = ConsoleColor.DarkBlue;
// Console.WriteLine($"{"".PadRight(Console.WindowWidth - 2, '█')}");
// Console.ResetColor();
// Center("");
Console.WriteLine($"Initializing {Assembly.GetExecutingAssembly().FullName.Split(",")[0]}");
// Center("");
// Console.BackgroundColor = ConsoleColor.DarkBlue;
// Console.WriteLine($"{"".PadRight(Console.WindowWidth - 2, '█')}");
// Console.ResetColor();
var bot = new Bot(LogLevel.Debug);
bot.RunAsync().Wait();
// Console.ForegroundColor = ConsoleColor.DarkRed;
// Console.WriteLine($"{"".PadRight(Console.WindowWidth - 2, '█')}");
// Center("");
Console.WriteLine($"Shutdown of {Assembly.GetExecutingAssembly().FullName.Split(",")[0]} successfull");
// Center("");
Console.WriteLine($"Press any key to exit the aplication..");
// Center("");
// Console.WriteLine($"{"".PadRight(Console.WindowWidth - 2, '█')}");
// Console.ResetColor();
Console.ReadKey(true);
Environment.Exit(0);
}
/// <summary>
/// Centers the console.
/// </summary>
/// <param name="s">The text.</param>
public static void Center(string s)
{
try
{
Console.BackgroundColor = ConsoleColor.DarkBlue;
Console.Write("██");
Console.SetCursorPosition((Console.WindowWidth - s.Length) / 2, Console.CursorTop);
Console.ResetColor();
Console.Write(s);
Console.BackgroundColor = ConsoleColor.DarkBlue;
Console.SetCursorPosition((Console.WindowWidth - 4), Console.CursorTop);
Console.WriteLine("██");
Console.ResetColor();
}
catch (Exception)
{
s = "Console to smoll EXC";
Console.SetCursorPosition((Console.WindowWidth - s.Length) / 2, Console.CursorTop);
Console.Write(s);
Console.SetCursorPosition((Console.WindowWidth - 4), Console.CursorTop);
Console.WriteLine("██");
}
}
}
}