public static void Alert(ColoredText alertMessage, int ms = 1000) { // Get position of the cursor before and after the alert. Int2 cursorPosition = Int2Utils.GetConsoleCursor(); Console.WriteLine(); Int2 newLinePosition = Int2Utils.GetConsoleCursor(); // Write the alert message. alertMessage.WriteAndResetColor(); // Show the alert during a certain amount of time. Thread.Sleep(ms); // Remove the text alert. newLinePosition.SetConsoleCursor(); for (int i = 0; i < alertMessage.Text.Length; ++i) { Console.Write(" "); } cursorPosition.SetConsoleCursor(); }
public static DateTime ReadLineDate(ColoredText question) { question.WriteLine(); return(ReadDate()); }
public static ConsoleKeyInfo ReadLineKey(ColoredText question) { question.WriteLine(); return(Console.ReadKey()); }
public static float ReadLineFloat(ColoredText question) { question.WriteLine(); return(ReadFloat()); }
public static double ReadLineDouble(ColoredText question) { question.WriteLine(); return(ReadDouble()); }
public static int ReadInt(ColoredText question) { question.Write(); return(ReadInt()); }
public static int ReadLineIntCancel(ColoredText question) { question.WriteLine(); return(ReadIntCancel()); }
public static string ReadLineCheckCancel(Func <string, bool> check, ColoredText question) { question.WriteLine(); return(ReadCheckCancel(check)); }
public static string ReadCheck(Func <string, bool> check, ColoredText question) { question.Write(); return(ReadCheck(check)); }
public static string ReadLineCancel(ColoredText question) { question.WriteLine(); return(ReadCancel()); }
public static string ReadLine(ColoredText question) { question.WriteLine(); return(Console.ReadLine()); }
public ColoredText(ColoredText coloredText) { Text = coloredText.Text; Color = coloredText.Color; }