mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-31 13:36:35 +08:00
尝试将节点流导出为c#代码文件
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Serein.Library;
|
||||
using Serein.Library.Api;
|
||||
using Serein.Library.Utils;
|
||||
using Serein.NodeFlow.Services;
|
||||
using Serein.NodeFlow.Tool;
|
||||
using System;
|
||||
@@ -25,7 +26,7 @@ namespace Serein.NodeFlow.Model.Operation
|
||||
/// <summary>
|
||||
/// 执行操作
|
||||
/// </summary>
|
||||
bool Execute();
|
||||
Task<bool> ExecuteAsync();
|
||||
/// <summary>
|
||||
/// 撤销操作
|
||||
/// </summary>
|
||||
@@ -46,6 +47,12 @@ namespace Serein.NodeFlow.Model.Operation
|
||||
[AutoInjection]
|
||||
protected FlowModelService flowModelService;
|
||||
|
||||
/// <summary>
|
||||
/// 节点管理服务
|
||||
/// </summary>
|
||||
[AutoInjection]
|
||||
protected UIContextOperation uiContextOperation;
|
||||
|
||||
/// <summary>
|
||||
/// 流程依赖服务
|
||||
/// </summary>
|
||||
@@ -75,7 +82,7 @@ namespace Serein.NodeFlow.Model.Operation
|
||||
/// <summary>
|
||||
/// 执行
|
||||
/// </summary>
|
||||
public abstract bool Execute();
|
||||
public abstract Task<bool> ExecuteAsync();
|
||||
|
||||
/// <summary>
|
||||
/// 撤销
|
||||
@@ -96,6 +103,23 @@ namespace Serein.NodeFlow.Model.Operation
|
||||
public abstract void ToInfo();
|
||||
|
||||
|
||||
protected async Task TriggerEvent(Action action)
|
||||
{
|
||||
/* if (OperatingSystem.IsWindows())
|
||||
{
|
||||
}*/
|
||||
if (uiContextOperation is null)
|
||||
{
|
||||
action?.Invoke();
|
||||
}
|
||||
else
|
||||
{
|
||||
await uiContextOperation.InvokeAsync(() =>
|
||||
{
|
||||
action?.Invoke();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user