コード例 #1
0
        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();
        }
コード例 #2
0
 public static DateTime ReadLineDate(ColoredText question)
 {
     question.WriteLine();
     return(ReadDate());
 }
コード例 #3
0
 public static ConsoleKeyInfo ReadLineKey(ColoredText question)
 {
     question.WriteLine();
     return(Console.ReadKey());
 }
コード例 #4
0
 public static float ReadLineFloat(ColoredText question)
 {
     question.WriteLine();
     return(ReadFloat());
 }
コード例 #5
0
 public static double ReadLineDouble(ColoredText question)
 {
     question.WriteLine();
     return(ReadDouble());
 }
コード例 #6
0
 public static int ReadInt(ColoredText question)
 {
     question.Write();
     return(ReadInt());
 }
コード例 #7
0
 public static int ReadLineIntCancel(ColoredText question)
 {
     question.WriteLine();
     return(ReadIntCancel());
 }
コード例 #8
0
 public static string ReadLineCheckCancel(Func <string, bool> check, ColoredText question)
 {
     question.WriteLine();
     return(ReadCheckCancel(check));
 }
コード例 #9
0
 public static string ReadCheck(Func <string, bool> check, ColoredText question)
 {
     question.Write();
     return(ReadCheck(check));
 }
コード例 #10
0
 public static string ReadLineCancel(ColoredText question)
 {
     question.WriteLine();
     return(ReadCancel());
 }
コード例 #11
0
 public static string ReadLine(ColoredText question)
 {
     question.WriteLine();
     return(Console.ReadLine());
 }
コード例 #12
0
 public ColoredText(ColoredText coloredText)
 {
     Text  = coloredText.Text;
     Color = coloredText.Color;
 }