protected void Write(ConsoleColor color, string format, params object[] args)
{
var message = string.Format(format, args);
lock(Console.Out) {
var tmp = Console.ForegroundColor;
Console.ForegroundColor = color;
Console.Out.Write(message);
Console.ForegroundColor = tmp;
}
}