Esempio n. 1
0
 /// <summary>
 /// Write an array of strings to the console in the given ConsoleColor,
 /// resetting the console foreground color upon completion.
 /// </summary>
 /// <param name="lines">The array of strings to write in the
 /// message.</param>
 /// <param name="textColor">The ConsoleColor to use for the text
 /// color.</param>
 public static void WriteHelp(string[] lines,
                              ConsoleColor textColor)
 {
     ValidateNoNulls(lines, textColor);
     foreach (string str in lines)
     {
         Universal.printf(str, textColor);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Print the byte[] to console, separated by spaces and space padded
        /// on the right to allow proper alignment for debug/testing output.
        /// </summary>
        /// <param name="bytes">The byte array to print to console.</param>
        public static void Print(this byte[] bytes)
        {
            ValidateNoNulls(bytes);
            string str = "";

            foreach (byte b in bytes)
            {
                str += (b.ToString() +
                        (b < 10 ? "   " :
                         (b < 100 ? "  " : " ")));
            }
            Universal.printf(str);
        }