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

namespace CommonHelpers {

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

public void OutputAlignedListItemCaption
(
   char? bulletChar, ConsoleColor? bulletColor,
   string caption, ConsoleColor? captionColor, int maxCaptionLength,
   [HOptional] string pairLigament, ConsoleColor? pairLigamentColor,
   bool multipleList = false
)
{
   lock (_InstanceSyncRoot_)
   {
      if ( bulletChar!=null )
         Output( bulletColor ?? ListItemBulletColor,
                 "{0} ", bulletChar );
      Output(captionColor ?? ListItemCaptionColor,caption);
      Output(new string(' ',HArith.ConfinePositiveOrZero(maxCaptionLength-caption.Length)));
      Output( pairLigamentColor ?? ListItemPairLigamentColor,
              pairLigament ?? ( multipleList ?
                                ListItemPairMultipleLigament : ListItemPairSingleLigament ) );
   }
}

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

public void OutputDashAlignedListItemCaption
(
   char? bulletChar, ConsoleColor? bulletColor,
   string caption, ConsoleColor? captionColor, int maxCaptionLength,
   char? dashChar, ConsoleColor? dashColor
)
{
   lock (_InstanceSyncRoot_)
   {
      if ( bulletChar!=null )
         Output( bulletColor ?? ListItemBulletColor,
                 "{0} ", bulletChar );
      Output( captionColor ?? ListItemCaptionColor,
              caption );
      Output
      (
         dashColor ?? ListItemDashColor,
         caption!="" ? " {0} " : "{0} ",
         new string( dashChar ?? ListItemDashChar, (caption!="" ? 0 : 1) +
            LongDashLength+HArith.ConfinePositiveOrZero( maxCaptionLength-caption.Length ) )
      );
   }
}

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

} // CommonHelpers
