public static void Main() { ConsoleWriter.InitializeConsoleWindow(); ConsoleWriter.InitializeContent(); OutPutRenderer.SelectOption(NonCostants.InitialContent()); Console.ReadLine(); }
public static void ShowBodiContent(string[] content, int index) { var totalRows = Constants.Ints.StarsEndRow - Constants.Ints.StarsStartRow; var rowDifference = totalRows / (content.Length + Constants.Ints.DefaultOne); var firstRow = Constants.Ints.StarsStartRow + rowDifference; foreach (var rowContent in content) { if (rowContent == content[index]) { Console.BackgroundColor = ConsoleColor.DarkGray; Console.ForegroundColor = ConsoleColor.White; } //else //{ // Console.BackgroundColor = ConsoleColor.Black; // Console.ForegroundColor = ConsoleColor.DarkGray; //} Console.SetCursorPosition(NonCostants.MiddleView(rowContent), firstRow); Console.Write(rowContent); firstRow += rowDifference; Console.BackgroundColor = ConsoleColor.Black; Console.ForegroundColor = ConsoleColor.DarkGray; } }
public static void ShowFutterAndHeader(string header) { var width = NonCostants.MiddleView(header); Console.SetCursorPosition(width, Constants.Ints.DefaultOne); Console.Write(header); Console.SetCursorPosition(Constants.Ints.DefaultOne, Constants.Ints.FutterRow); Console.Write(Constants.Strings.MenuLeft); width = NonCostants.MiddleView(Constants.Strings.MenuMiddle); Console.SetCursorPosition(width, Constants.Ints.FutterRow); Console.Write(Constants.Strings.MenuMiddle); width = Console.WindowWidth - Constants.Strings.MenuRight.Length - Constants.Ints.DefaultOne; Console.SetCursorPosition(width, Constants.Ints.FutterRow); Console.Write(Constants.Strings.MenuRight); }
public static void SelectOption(string[] options) { var index = Constants.Ints.DefaultZero; ConsoleKeyInfo keyInfo = new ConsoleKeyInfo(); while (keyInfo.Key != ConsoleKey.Enter) { keyInfo = Console.ReadKey(); NonCostants.ClearKeyBuffer(); if (keyInfo.Key == ConsoleKey.UpArrow || keyInfo.Key == ConsoleKey.LeftArrow) { index = index == 0 ? options.Length - 1 : index - 1; } if (keyInfo.Key == ConsoleKey.DownArrow || keyInfo.Key == ConsoleKey.RightArrow) { index = Math.Abs((index + 1) % options.Length); } if (keyInfo.Key == ConsoleKey.Enter) { } ConsoleWriteHelper.ShowBodiContent(options, index); } }
public static void InitializeContent() { ConsoleWriteHelper.ShowFrame(); ConsoleWriteHelper.ShowFutterAndHeader(Constants.Strings.WelcomeText); ConsoleWriteHelper.ShowBodiContent(NonCostants.InitialContent(), 0); }