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

using CommonHelpers.WASM;

namespace AFXUI {

//**************************************************************************************************
static partial class UCircuit {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sealed class ExclusiveOperationInfo
{
   public readonly int Level;
   public readonly Type Type;
   public readonly ComponentBase? Component;
   public readonly string MethodNameOrSignature;
   public bool Conceded, Closed, Intercepted, AwaitInterception;
   public ExclusiveOperationInfo( int level, Type type,
                                  ComponentBase? component,
                                  string methodNameOrSignature )
   {
      Level = level;
      Type = type;
      Component = component;
      MethodNameOrSignature = methodNameOrSignature;
   }
   public ExclusiveOperationInfo Duplicate() =>
      (ExclusiveOperationInfo)MemberwiseClone();
} // ExclusiveOperationInfo
//**************************************************************************************************
class ExclusiveOpLevelData
{
   public ExclusiveOperationInfo? Context, LastContext;
   public int SyncEntryCount, AsyncEntryCount;
   public int SyncEntryCount_Visible, AsyncEntryCount_Visible;
   public bool TraceSyncExit;
} // ExclusiveOperationLevel
//**************************************************************************************************
class ExclusiveRejectionParams
{
   public readonly UFuncTraceOptions TraceOptions;
   public readonly int Exclusive;
   public readonly int Level;
   public readonly Type Type;
   public readonly string MethodNameOrSignature;
   public ExclusiveRejectionParams( UFuncTraceOptions traceOptions,
                                    int exclusive, int level,
                                    Type type, string methodNameOrSignature )
   {
      TraceOptions = traceOptions;
      Exclusive = exclusive;
      Level = level;
      Type = type;
      MethodNameOrSignature = methodNameOrSignature;
   }
} // ExclusiveRejectionParams
//**************************************************************************************************
class TraceParameters
{
   public readonly UFuncTraceOptions TraceOptions;
   public readonly int Level;
   public readonly Type Type;
   public readonly string? MethodNameOrSignature;
   public TraceParameters( UFuncTraceOptions traceOptions, int level,
                           Type type, string? methodNameOrSignature )
   {
      TraceOptions = traceOptions;
      Level = level;
      Type = type;
      MethodNameOrSignature = methodNameOrSignature;
   }
} // TraceParameters
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // UCircuit
//**************************************************************************************************

} // AFXUI
