Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void WriterHeader(string writeWhat, byte fara8, char mnBara)
- {
- if (fara8 > 43) fara8 = 43;
- System.Console.OutputEncoding = System.Console.InputEncoding = Encoding.UTF8;
- System.Console.ForegroundColor = ConsoleColor.DarkGray;
- string text = "";
- string adEh = "";
- for (int i = 0; i < fara8; i++) adEh += " ";
- text += mnBara + adEh;
- text += writeWhat;
- text += adEh + mnBara;
- string header = "";
- for (int i = 0; i < text.Length; i++) header += mnBara;
- string emptyLine = "";
- for (int i = 0; i < text.Length; i++)
- {
- if (i == 0 || i == text.Length - 1)
- emptyLine += mnBara;
- else emptyLine += " ";
- }
- string[] whatToWrite = new string[] { header, emptyLine, emptyLine, text, emptyLine, emptyLine, header };
- foreach (var line in whatToWrite)
- {
- Console.SetCursorPosition((Console.WindowWidth - line.Length) / 2, Console.CursorTop);
- Console.WriteLine(line);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement