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

namespace CommonHelpers {

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

public void PrintDashAlignedList( bool insertBlankLine, [HOptional] string caption,
                                  string[] captions, string[] values )
{
   PrintListCaption( insertBlankLine, caption );
   PrintDashAlignedList( false, captions, values );
}

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

public void PrintDashAlignedList(bool insertBlankLine,string[] captions,string[] values)
{
   PrintDashAlignedList(
      insertBlankLine,
      captions, null,
      values, null,
      null, null,
      null, null );
}

public void PrintDashAlignedList( bool insertBlankLine,
                                  string[] captions,
                                  ConsoleColor? captionColor,
                                  string[] values )
{
   PrintDashAlignedList(
      insertBlankLine,
      captions, captionColor,
      values, null,
      null, null,
      null, null );
}

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

public void PrintDashAlignedList( bool insertBlankLine,
                                  string[] captions,
                                  string[] values,
                                  ConsoleColor? valueColor )
{
   PrintDashAlignedList(
      insertBlankLine,
      captions, null,
      values, valueColor,
      null, null,
      null, null );
}

public void PrintDashAlignedList( bool insertBlankLine,
                                  string[] captions, ConsoleColor? captionColor,
                                  string[] values, ConsoleColor? valueColor )
{
   PrintDashAlignedList(
      insertBlankLine,
      captions, captionColor,
      values, valueColor,
      null, null,
      null, null );
}

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

public void PrintDashAlignedList( bool insertBlankLine,
                                  string[] captions, ConsoleColor? captionColor,
                                  string[] values, ConsoleColor? valueColor,
                                  ConsoleColor? dashColor )
{
   PrintDashAlignedList(
      insertBlankLine,
      captions, captionColor,
      values, valueColor,
      null, null,
      null, dashColor );
}

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

public void PrintDashAlignedList( bool insertBlankLine,
                                  string[] captions, ConsoleColor? captionColor,
                                  string[] values, ConsoleColor? valueColor,
                                  char? bulletChar, ConsoleColor? bulletColor,
                                  char? dashChar, ConsoleColor? dashColor )
{
   HArgChecking.VerifyNotNulls(captions,values);
   HArgChecking.VerifyNotNulls(captions);
   HArgChecking.VerifyNotNulls(values);

   if (captions.Length!=values.Length)
      throw HArgChecking.ArgumentException_IncorrectArguments;

   if (insertBlankLine)
      Print();

   int maxCaptionLength = HString.MaxLength( captions );

   lock (_InstanceSyncRoot_)
      for (int i=0; i<captions.Length; i++)
      {
         OutputDashAlignedListItemCaption
         (
            bulletChar, bulletColor,
            HArray.GetAtZeroBasedIndex(captions,i), captionColor, maxCaptionLength,
            dashChar, dashColor
         );
         Print( valueColor ?? ListItemValueColor,
                HArray.GetAtZeroBasedIndex(values,i) );
      }
}

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

} // CommonHelpers
