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

namespace CommonHelpers {

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

public void PrintUnderbarCaption(char underbarChar,ConsoleColor? color,string caption)
{
   PrintUnderbarCaption(false,underbarChar,color,caption);
}

public void PrintUnderbarCaption( char underbarChar, ConsoleColor? color,
                                  string captionFmt, params object[] parameters )
{
   PrintUnderbarCaption(false,underbarChar,color,captionFmt,parameters);
}

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

public void PrintUnderbarCaption( bool insertBlankLine,
                                  char underbarChar,
                                  ConsoleColor? color,
                                  string caption )
{
   HArgChecking.VerifyNotNull(caption);
   lock (_InstanceSyncRoot_)
   {
      Print(insertBlankLine,color,caption);
      Print( color,
         new string( underbarChar,
            IsInNativeVisualMode ? Math.Min(caption.Length,Width) : caption.Length  ) );
   }
}

public void PrintUnderbarCaption( bool insertBlankLine,
                                  char underbarChar, ConsoleColor? color,
                                  string captionFmt, params object[] parameters )
{
   PrintUnderbarCaption(insertBlankLine,underbarChar,color,string.Format(captionFmt,parameters));
}

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

} // CommonHelpers
