//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// AFXUI auxiliary module for Blazor-application (WASM) | Author: Sergei Y.Kitáev
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using System;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;

using CommonHelpers.WASM;

namespace AFXUI {

//**************************************************************************************************
static partial class UCircuit {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

public static int Do( this ComponentBase component, int exclusive, Action body,
                      [CallerMemberName] string? methodNameOrSignature=null ) =>
   Do( component, exclusive, new UCircuitExtraParams(), body, methodNameOrSignature );

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

public static Task<int> Do_A( this ComponentBase component, int exclusive, Func<Task> bodyA,
                              [CallerMemberName] string? methodNameOrSignature=null ) =>
   Do_A( component, exclusive, new UCircuitExtraParams(), bodyA, methodNameOrSignature );
public static Task<int> Do_A( this ComponentBase component, int exclusive,
                              Func<bool>? preliminary, Func<Task> bodyA,
                              [CallerMemberName] string? methodNameOrSignature=null ) =>
   Do_A( component, exclusive, new UCircuitExtraParams(), preliminary, bodyA,
         methodNameOrSignature );

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

public static int Do( this ComponentBase component, int exclusive,
                      UCircuitExtraParams extraParams, Action body,
                      [CallerMemberName] string? methodNameOrSignature=null ) =>
   BaseDo( exclusive, component.GetType(), component, methodNameOrSignature, extraParams, body );

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

public static Task<int> Do_A( this ComponentBase component, int exclusive,
                              UCircuitExtraParams extraParams, Func<Task> bodyA,
                              [CallerMemberName] string? methodNameOrSignature=null ) =>
   BaseDo_A( exclusive, component.GetType(), component, methodNameOrSignature, extraParams, bodyA );
public static Task<int> Do_A( this ComponentBase component, int exclusive,
                              UCircuitExtraParams extraParams,
                              Func<bool>? preliminary, Func<Task> bodyA,
                              [CallerMemberName] string? methodNameOrSignature=null ) =>
   BaseDo_A( exclusive, component.GetType(), component, methodNameOrSignature, extraParams,
             preliminary, bodyA );

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // UCircuit
//**************************************************************************************************

} // AFXUI
