优化了脚本生成AST时的代码提示,增加了脚本运行时错误提示。

This commit is contained in:
fengjiayi
2025-07-09 21:49:26 +08:00
parent 4da8bf6b84
commit 70f674ca1b
32 changed files with 1218 additions and 266 deletions

View File

@@ -101,8 +101,6 @@ namespace Serein.Library
#endregion
/// <summary>
/// 设置运行流程
/// </summary>
@@ -138,8 +136,35 @@ namespace Serein.Library
}
/// <summary>
/// 尝试在UI线程上触发事件
/// </summary>
/// <param name="action"></param>
/// <returns></returns>
public async static Task TriggerEvent(Action action)
{
if (environment is null)
{
action?.Invoke();
}
else
{
var uco = environment.UIContextOperation;
if (uco is null)
{
action?.Invoke();
}
else
{
await uco.InvokeAsync(() =>
{
action?.Invoke();
});
}
}
}
}