using System;
using System.ComponentModel;
namespace Common.Tools
{
///
/// 步骤运行时上下文桥接器(命令库与宿主之间的依赖倒置通道)。
///
/// 命令库(Command 项目)不引用宿主类型,无法直接访问步骤管理器的数据;
/// 宿主(StepRunning)在执行测试步骤前,将当前作用域的步骤耗时查询委托写入
/// ;命令库中的耗时统计命令在执行时读取该委托完成查询。
///
///
/// 使用 承载:委托随异步执行流(ExecutionContext)流动,
/// 多台架并发运行时各自持有自己作用域的查询器,天然隔离互不串扰。
///
///
public static class StepRuntimeContext
{
///
/// 当前异步执行流的步骤耗时查询委托:(起始序号, 结束序号) → 该范围内步骤运行时间之和(毫秒)。
/// 由宿主(StepRunning)在每次执行测试步骤方法前设置;未设置时命令侧按未注入处理。
///
[Browsable(false)]
public static readonly AsyncLocal?> StepTimeQuery = new();
}
}