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

namespace CommonHelpers {

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

public void PrintSplitter()
{
   PrintSplitter(false,false,false,false);
}

public void PrintSplitter(bool insertPrecedingBlankLine)
{
   PrintSplitter(false,false,insertPrecedingBlankLine,false);
}

public void PrintSplitter(bool insertPrecedingBlankLine,bool insertPosteriorBlankLine)
{
   PrintSplitter(false,false,insertPrecedingBlankLine,insertPosteriorBlankLine);
}

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

public void PrintDoubleSplitter()
{
   PrintSplitter(false,true,false,false);
}

public void PrintDoubleSplitter(bool insertPrecedingBlankLine)
{
   PrintSplitter(false,true,insertPrecedingBlankLine,false);
}

public void PrintDoubleSplitter(bool insertPrecedingBlankLine,bool insertPosteriorBlankLine)
{
   PrintSplitter(false,true,insertPrecedingBlankLine,insertPosteriorBlankLine);
}

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

public void PrintShallowSplitter()
{
   PrintSplitter(true,false,false,false);
}

public void PrintShallowSplitter(bool insertPrecedingBlankLine)
{
   PrintSplitter(true,false,insertPrecedingBlankLine,false);
}

public void PrintShallowSplitter(bool insertPrecedingBlankLine,bool insertPosteriorBlankLine)
{
   PrintSplitter(true,false,insertPrecedingBlankLine,insertPosteriorBlankLine);
}

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

public void PrintShallowDoubleSplitter()
{
   PrintSplitter(true,true,false,false);
}

public void PrintShallowDoubleSplitter(bool insertPrecedingBlankLine)
{
   PrintSplitter(true,true,insertPrecedingBlankLine,false);
}

public void PrintShallowDoubleSplitter(bool insertPrecedingBlankLine,bool insertPosteriorBlankLine)
{
   PrintSplitter(true,true,insertPrecedingBlankLine,insertPosteriorBlankLine);
}

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

void PrintSplitter( bool isShallow, bool isDouble,
                    bool insertPrecedingBlankLine,
                    bool insertPosteriorBlankLine )
{
   char ch;

   if (isShallow)
      if (isDouble) ch=ShallowDoubleSplitterChar;
      else ch=ShallowSplitterChar;
   else
      if (isDouble) ch=DoubleSplitterChar;
      else ch=SplitterChar;

   lock (_InstanceSyncRoot_)
   {
      if (insertPrecedingBlankLine)
         Print();
      Print( isShallow ? ShallowSplitterColor : SplitterColor,
             new string(ch,NormLimitedWidth) );
      if (insertPosteriorBlankLine)
         Print();
   }
}

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

} // CommonHelpers
