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

using System.Windows;

using CommonHelpers;

namespace UserWin {

//**************************************************************************************************
partial class UXMessageBox {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

public static async Task ShowMessage(
   [HOptional] UXShowMessageExtraInfo extraInfo, string text,
   [HOptional] string caption, MessageBoxImage icon )
{
   await ShowMessage( extraInfo, (Window)null, text, caption, icon );
}

public static async Task<MessageBoxResult> ShowMessage(
   [HOptional] UXShowMessageExtraInfo extraInfo,
   string text, [HOptional] string caption,
   MessageBoxButton button, MessageBoxImage icon )
{
   return await ShowMessage( extraInfo, (Window)null, text, caption, button, icon );
}

public static async Task<MessageBoxResult> ShowMessage(
   [HOptional] UXShowMessageExtraInfo extraInfo,
   string text, [HOptional] string caption,
   MessageBoxButton button, MessageBoxImage icon,
   MessageBoxResult defaultResult )
{
   return await ShowMessage( extraInfo, (Window)null, text, caption, button, icon, defaultResult );
}

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

public static async Task ShowMessage(
   [HOptional] UXShowMessageExtraInfo extraInfo,
   [HOptional] Window owner, string text, [HOptional] string caption,
   MessageBoxImage icon )
{
   await ShowMessage( extraInfo, owner, text, caption, MessageBoxButton.OK, icon );
}

public static async Task<MessageBoxResult> ShowMessage(
   [HOptional] UXShowMessageExtraInfo extraInfo,
   [HOptional] Window owner, string text,
   [HOptional] string caption, MessageBoxButton button,
   MessageBoxImage icon )
{
   return await ShowMessage( extraInfo, owner,
      text, caption, button, icon,
      DefaultResultFromButton(button) );
}

public static async Task<MessageBoxResult> ShowMessage(
   [HOptional] UXShowMessageExtraInfo extraInfo,
   [HOptional] Window owner, string text,
   [HOptional] string caption, MessageBoxButton button,
   MessageBoxImage icon, MessageBoxResult defaultResult )
{
   HProgram.VerifyInMainThread();
   return await DoShowMessage(
      extraInfo ?? new UXShowMessageExtraInfo( HSounds.Default ),
      owner, text, caption, button, icon, defaultResult );
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // UXMessageBox
//**************************************************************************************************

} // UserWin
