using System;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;

using CommonHelpers.WASM;
using AFXUI;

namespace BookRegistry.Client.Shared {

//**************************************************************************************************
partial class MessageBox {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

public Task ESC_ShowMessageFmt_A( string messageFmt, params object?[] parameters ) =>
   ESC_ShowMessageWithTitleFmt_A( null, messageFmt, parameters );
public Task ESC_ShowMessageWithTitleFmt_A( string? title,
                                           string messageFmt, params object?[] parameters ) =>
   ESC_ShowMessage_A( title, string.Format( messageFmt, parameters ) );

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

public Task ESC_ShowExclamationFmt_A( string messageFmt, params object?[] parameters ) =>
   ESC_ShowExclamationWithTitleFmt_A( null, messageFmt, parameters );
public Task ESC_ShowExclamationWithTitleFmt_A( string? title,
                                               string messageFmt, params object?[] parameters ) =>
   ESC_ShowExclamation_A( title, string.Format( messageFmt, parameters ) );

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

public Task ESC_ShowCompletionFmt_A( string messageFmt, params object?[] parameters ) =>
   ESC_ShowCompletionWithTitleFmt_A( null, messageFmt, parameters );
public Task ESC_ShowCompletionWithTitleFmt_A( string? title,
                                              string messageFmt, params object?[] parameters ) =>
   ESC_ShowCompletion_A( title, string.Format( messageFmt, parameters ) );

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

public Task ESC_ShowSuccessFmt_A( string messageFmt, params object?[] parameters ) =>
   ESC_ShowSuccessWithTitleFmt_A( null, messageFmt, parameters );
public Task ESC_ShowSuccessWithTitleFmt_A( string? title,
                                           string messageFmt, params object?[] parameters ) =>
   ESC_ShowSuccess_A( title, string.Format( messageFmt, parameters ) );

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

public Task ESC_ShowErrorFmt_A( string messageFmt, params object?[] parameters ) =>
   ESC_ShowErrorWithTitleFmt_A( null, messageFmt, parameters );
public Task ESC_ShowErrorWithTitleFmt_A( string? title,
                                         string messageFmt, params object?[] parameters ) =>
   ESC_ShowError_A( title, string.Format( messageFmt, parameters ) );

public Task ESC_ShowCommunicationErrorFmt_A( string messageFmt, params object?[] parameters ) =>
   ESC_ShowCommunicationErrorFmt_A( string.Format( messageFmt, parameters ) );

public Task ESC_ShowServerErrorFmt_A( string messageFmt, params object?[] parameters ) =>
   ESC_ShowServerError_A( string.Format( messageFmt, parameters ) );

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

public Task<bool> ESC_ConfirmationDialogFmt_A( string messageFmt, params object?[] parameters ) =>
   ESC_ConfirmationDialogWithTitleFmt_A( null, messageFmt, parameters );
public Task<bool> ESC_ConfirmationDialogWithTitleFmt_A( string? title,
                                                        string messageFmt,
                                                        params object?[] parameters ) =>
   ESC_ConfirmationDialog_A( title, string.Format( messageFmt, parameters ) );

public Task<bool> ESC_ConfirmationDialogFmt_A( bool confirmationFocusing,
                                               string messageFmt, params object?[] parameters ) =>
   ESC_ConfirmationDialogWithTitleFmt_A( confirmationFocusing, null, messageFmt, parameters );
public Task<bool> ESC_ConfirmationDialogWithTitleFmt_A( bool confirmationFocusing,
                                                        string? title,
                                                        string messageFmt,
                                                        params object?[] parameters ) =>
   ESC_ConfirmationDialog_A( title, string.Format( messageFmt, parameters ), confirmationFocusing );

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

public Task<bool> ESC_ImportantConfirmationDialogFmt_A( string messageFmt,
                                                        params object?[] parameters ) =>
   ESC_ImportantConfirmationDialogWithTitleFmt_A( null, messageFmt, parameters );
public Task<bool> ESC_ImportantConfirmationDialogWithTitleFmt_A( string? title,
                                                                 string messageFmt,
                                                                 params object?[] parameters ) =>
   ESC_ImportantConfirmationDialog_A( title, string.Format( messageFmt, parameters ) );

public Task<bool> ESC_ImportantConfirmationDialogFmt_A( bool confirmationFocusing,
                                                        string messageFmt,
                                                        params object?[] parameters ) =>
   ESC_ImportantConfirmationDialogWithTitleFmt_A( confirmationFocusing, null,
                                                  messageFmt, parameters );
public Task<bool> ESC_ImportantConfirmationDialogWithTitleFmt_A( bool confirmationFocusing,
                                                                 string? title,
                                                                 string messageFmt,
                                                                 params object?[] parameters ) =>
   ESC_ImportantConfirmationDialog_A( confirmationFocusing,
                                      title, string.Format( messageFmt, parameters ) );

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

public Task<bool> ESC_QuestionDialogFmt_A( string messageFmt, params object?[] parameters ) =>
   ESC_QuestionDialogWithTitleFmt_A( null, messageFmt, parameters );
public Task<bool> ESC_QuestionDialogWithTitleFmt_A( string? title,
                                                    string messageFmt,
                                                    params object?[] parameters ) =>
   ESC_QuestionDialog_A( title, string.Format( messageFmt, parameters ) );

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // MessageBox
//**************************************************************************************************

} // BookRegistry.Client.Shared
