//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// CommonHelpers satellite library | Author: Sergei Y.Kitáev
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using System;

namespace CommonHelpers {

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

public void Print(bool insertBlankLine,object obj)
{
   Print(insertBlankLine,(ConsoleColor?)null,obj);
}

public void Print(bool insertBlankLine,string str)
{
   Print(insertBlankLine,null,str);
}

public void Print(bool insertBlankLine,string format,params object[] parameters)
{
   Print(insertBlankLine,null,format,parameters);
}

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

public void Print(bool insertBlankLine,ConsoleColor? color,object obj)
{
   Print(insertBlankLine,color,obj.ToString());
}

public void Print(bool insertBlankLine,ConsoleColor? color,string str)
{
   lock (_InstanceSyncRoot_)
      Output( color, "{0}{1}\n",
         insertBlankLine ? "\n" : "",
         str );
}

public void Print( bool insertBlankLine, ConsoleColor? color,
                   string format, params object[] parameters )
{
   Print(insertBlankLine,color,string.Format(format,parameters));
}

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

public void PrintDefault(bool insertBlankLine,object obj)
{
   Print(insertBlankLine,Console.ForegroundColor,obj);
}

public void PrintDefault(bool insertBlankLine,string str)
{
   Print(insertBlankLine,Console.ForegroundColor,str);
}

public void PrintDefault(bool insertBlankLine,string format,params object[] parameters)
{
   Print(insertBlankLine,Console.ForegroundColor,string.Format(format,parameters));
}

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

public void PrintIntensive(bool insertBlankLine,object obj)
   { PrintWithExpansion(insertBlankLine,IntensiveColor,obj); }

public void PrintIntensive(bool insertBlankLine,string str)
   { PrintWithExpansion(insertBlankLine,IntensiveColor,str); }

public void PrintIntensive(bool insertBlankLine,string format,params object[] parameters)
   { PrintWithExpansion(insertBlankLine,IntensiveColor,format,parameters); }

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

public void PrintFaint(bool insertBlankLine,object obj)
   { PrintWithExpansion(insertBlankLine,FaintColor,obj); }

public void PrintFaint(bool insertBlankLine,string str)
   { PrintWithExpansion(insertBlankLine,FaintColor,str); }

public void PrintFaint(bool insertBlankLine,string format,params object[] parameters)
   { PrintWithExpansion(insertBlankLine,FaintColor,format,parameters); }

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

public void PrintExpressive(bool insertBlankLine,object obj)
   { PrintWithExpansion(insertBlankLine,ExpressiveColor,obj); }

public void PrintExpressive(bool insertBlankLine,string str)
   { PrintWithExpansion(insertBlankLine,ExpressiveColor,str); }

public void PrintExpressive(bool insertBlankLine,string format,params object[] parameters)
   { PrintWithExpansion(insertBlankLine,ExpressiveColor,format,parameters); }

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

public void PrintImportant(bool insertBlankLine,object obj)
   { PrintWithExpansion(insertBlankLine,ImportantColor,obj); }

public void PrintImportant(bool insertBlankLine,string str)
   { PrintWithExpansion(insertBlankLine,ImportantColor,str); }

public void PrintImportant(bool insertBlankLine,string format,params object[] parameters)
   { PrintWithExpansion(insertBlankLine,ImportantColor,format,parameters); }

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

public void PrintExclamation(bool insertBlankLine,object obj)
   { PrintWithExpansion(insertBlankLine,ExclamationColor,obj); }

public void PrintExclamation(bool insertBlankLine,string str)
   { PrintWithExpansion(insertBlankLine,ExclamationColor,str); }

public void PrintExclamation( bool insertBlankLine,
                              string format,
                              params object[] parameters )
   { PrintWithExpansion(insertBlankLine,ExclamationColor,format,parameters); }

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

public void PrintInformation(bool insertBlankLine,object obj)
   { PrintWithExpansion(insertBlankLine,InformationColor,obj); }

public void PrintInformation(bool insertBlankLine,string str)
   { PrintWithExpansion(insertBlankLine,InformationColor,str); }

public void PrintInformation(bool insertBlankLine,string format,params object[] parameters)
   { PrintWithExpansion(insertBlankLine,InformationColor,format,parameters); }

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

public void PrintWarning(bool insertBlankLine,object obj)
   { PrintWithExpansion(insertBlankLine,WarningColor,obj); }

public void PrintWarning(bool insertBlankLine,string str)
   { PrintWithExpansion(insertBlankLine,WarningColor,str); }

public void PrintWarning(bool insertBlankLine,string format,params object[] parameters)
   { PrintWithExpansion(insertBlankLine,WarningColor,format,parameters); }

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

public void PrintError(bool insertBlankLine,string str)
   { PrintWithExpansion(insertBlankLine,ErrorColor,str); }

public void PrintError(bool insertBlankLine,string format,params object[] parameters)
   { PrintWithExpansion(insertBlankLine,ErrorColor,format,parameters); }

public void PrintError(bool insertBlankLine,Exception e)
   { PrintWithExpansion(insertBlankLine,ErrorColor,HException.GetErrorMessage(e)); }

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

public void PrintSuccess(bool insertBlankLine,string str)
   { PrintWithExpansion(insertBlankLine,SuccessColor,str); }

public void PrintSuccess(bool insertBlankLine,string format,params object[] parameters)
   { PrintWithExpansion(insertBlankLine,SuccessColor,format,parameters); }

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

public void PrintOperation(bool insertBlankLine,string operation)
{
   if ( insertBlankLine ) Print( OperationColor );
   PrintWithNewLineInBuffer( true, OperationColor,
      ExpandOutputText( OperationFormatString, operation ) );
}

public void PrintOperation(bool insertBlankLine,string operationFmt,params object[] parameters)
{
   PrintOperation(insertBlankLine,string.Format(operationFmt,parameters));
}

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

public void PrintWithExpansion(bool insertBlankLine,ConsoleColor? color,object obj)
{
   PrintWithExpansion( insertBlankLine, color,
      ExpandOutputText( obj!=null ? obj.ToString() : "" ) );
}

public void PrintWithExpansion(bool insertBlankLine,ConsoleColor? color,string str)
{
   HArgChecking.VerifyNotNull( str );
   Print( insertBlankLine, color, ExpandOutputText( str ) );
}

public void PrintWithExpansion( bool insertBlankLine, ConsoleColor? color,
                                string format, params object[] parameters )
{
   HArgChecking.VerifyNotNull( format );
   PrintWithExpansion( insertBlankLine, color, string.Format( format, parameters ) );
}

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

} // CommonHelpers
