using System;

namespace CommonHelpers {

//**************************************************************************************************
static partial class HConsole {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

public static void PrintError(bool insertBlankLine,string message)
{
   Print( insertBlankLine, ErrorColor, message );
}
public static void PrintError(bool insertBlankLine,string messageFmt,params object[] parameters)
{
   PrintError( insertBlankLine, string.Format( messageFmt, parameters ) );
}
public static void PrintError(bool insertBlankLine,Exception e)
{
   PrintError( insertBlankLine, e.ToString() );
}

public static void PrintIntensive(bool insertBlankLine,string message)
{
   Print( insertBlankLine, IntensiveColor, message );
}
public static void PrintIntensive(bool insertBlankLine,string messageFmt,params object[] parameters)
{
   PrintIntensive( insertBlankLine, string.Format( messageFmt, parameters ) );
}

public static void PrintExpressive(bool insertBlankLine,string message)
{
   Print( insertBlankLine, ExpressiveColor, message );
}
public static void PrintExpressive( bool insertBlankLine,
                                    string messageFmt,
                                    params object[] parameters )
{
   PrintExpressive( insertBlankLine, string.Format( messageFmt, parameters ) );
}

public static void PrintExclamation(bool insertBlankLine,string message)
{
   Print( insertBlankLine, ExclamationColor, message );
}
public static void PrintExclamation( bool insertBlankLine,
                                     string messageFmt,
                                     params object[] parameters )
{
   PrintExclamation( insertBlankLine, string.Format( messageFmt, parameters ) );
}

public static void PrintFaint(bool insertBlankLine,string message)
{
   Print( insertBlankLine, FaintColor, message );
}
public static void PrintFaint( bool insertBlankLine,
                               string messageFmt,
                               params object[] parameters )
{
   PrintFaint( insertBlankLine, string.Format( messageFmt, parameters ) );
}

//--------------------------------------------------------------------------------------------------

public static void PrintOperation(bool insertBlankLine,string message)
{
   Print( insertBlankLine, OperationColor, "* {0} ...", message );
}
public static void PrintOperation( bool insertBlankLine,
                                   string messageFmt,
                                   params object[] parameters )
{
   PrintOperation( insertBlankLine, string.Format( messageFmt, parameters ) );
}

//==================================================================================================

public static void PrintInherited(bool insertBlankLine,string message)
{
   Print( insertBlankLine, null, IntensiveColor, message );
}
public static void PrintInherited(bool insertBlankLine,string messageFmt,params object[] parameters)
{
   PrintInherited( insertBlankLine, string.Format( messageFmt, parameters ) );
}

//==================================================================================================

public static void Print(bool insertBlankLine,string message)
{
   Print( insertBlankLine, NormalColor, message );
}
public static void Print(bool insertBlankLine,string messageFmt,params object[] parameters)
{
   Print( insertBlankLine, NormalColor, messageFmt, parameters );
}

//--------------------------------------------------------------------------------------------------

public static void Print(bool insertBlankLine,ConsoleColor? color,string message)
{
   if ( insertBlankLine )
      Console.WriteLine();
   if ( color.HasValue )
      Console.ForegroundColor = color.Value;
   try
   {
      Console.WriteLine( message );
   }
   finally
   {
      if ( color.HasValue )
         Console.ForegroundColor = InitialForeColor;
   }
}
public static void Print( bool insertBlankLine, ConsoleColor? color,
                          string messageFmt, params object[] parameters )
{
   Print( insertBlankLine, color, string.Format( messageFmt, parameters ) );
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // HConsole
//**************************************************************************************************

} // CommonHelpers
