コード例 #1
0
        void AppendFormatted(string message, Color foreColor)
        {
            int  index = 0;
            char col   = 'S';

            message = UIHelpers.Format(message);

            while (index < message.Length)
            {
                char   curCol = col;
                string part   = UIHelpers.OutputPart(ref col, ref index, message);
                if (part.Length > 0)
                {
                    AppendColoredText(part, GetCol(curCol, foreColor));
                }
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: marvelgit/MCGalaxy
 static void Write(string message) {
     int index = 0;
     char col = 'S';
     message = UIHelpers.Format(message);
     
     while (index < message.Length) {
         char curCol = col;
         string part = UIHelpers.OutputPart(ref col, ref index, message);
         if (part.Length > 0) {
             Console.ForegroundColor = GetConsoleCol(curCol);
             Console.Write(part);
         }
     }
     
     Console.ForegroundColor = ConsoleColor.White;
     Console.WriteLine();
 }