2025-07-30 11:29:12 +08:00
|
|
|
|
using Serein.Extend.NewtonsoftJson;
|
|
|
|
|
|
using Serein.Library;
|
2024-09-17 14:20:27 +08:00
|
|
|
|
using Serein.Library.Api;
|
2024-09-15 12:15:32 +08:00
|
|
|
|
using Serein.Library.Utils;
|
2025-06-22 21:53:37 +08:00
|
|
|
|
using Serein.NodeFlow.Services;
|
2024-09-15 12:15:32 +08:00
|
|
|
|
|
2024-10-20 12:10:57 +08:00
|
|
|
|
namespace Serein.NodeFlow.Env
|
2024-09-15 12:15:32 +08:00
|
|
|
|
{
|
2025-07-04 15:46:29 +08:00
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
SetExportDirectory(string directory)
|
|
|
|
|
|
UseRemoteEdit(string wspath)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IFlowEnvironment env = new ();
|
|
|
|
|
|
env.LoadProject()
|
|
|
|
|
|
|
|
|
|
|
|
List<FlowApiInfo> apiInfos = env.GetInterfaceInfo();
|
|
|
|
|
|
List<FlowEventInfo> enventInfos = env.GetEventInfo();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
flowApiService = env.GetFlowApiService();
|
|
|
|
|
|
flowEventService = env.GetFlowEventService();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
object result = flowApiService.Invoke("", params);
|
|
|
|
|
|
TResult result = flowApiService.Invoke<TResult>("", params);
|
|
|
|
|
|
object result = await flowApiService.InvokeAsync("", params);
|
|
|
|
|
|
TResult result = await flowApiService.InvokeAsync<TResult>("", params);
|
|
|
|
|
|
|
|
|
|
|
|
flowEventService.Monitor("", (e) => {
|
|
|
|
|
|
object data = e.EventData;
|
|
|
|
|
|
Debug.Writeline(e.EventName);
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-15 12:15:32 +08:00
|
|
|
|
/// <summary>
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// 流程运行环境
|
2024-09-15 12:15:32 +08:00
|
|
|
|
/// </summary>
|
2025-06-02 19:17:30 +08:00
|
|
|
|
public class FlowEnvironment : IFlowEnvironment
|
2024-09-15 12:15:32 +08:00
|
|
|
|
{
|
2025-07-04 21:31:07 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 流程运行环境构造函数
|
|
|
|
|
|
/// </summary>
|
2025-01-22 21:09:52 +08:00
|
|
|
|
public FlowEnvironment()
|
2024-09-20 10:50:32 +08:00
|
|
|
|
{
|
2025-07-04 15:46:29 +08:00
|
|
|
|
ISereinIOC ioc = new SereinIOC();
|
2026-01-27 17:24:19 +08:00
|
|
|
|
ioc.Register<ISereinIOC>(() => ioc) // IOC容器接口
|
2025-07-08 14:22:41 +08:00
|
|
|
|
.Register<IFlowEnvironment>(() => this) // 流程环境接口
|
|
|
|
|
|
.Register<IFlowEnvironmentEvent, FlowEnvironmentEvent>() // 流程环境事件接口
|
|
|
|
|
|
.Register<IFlowEdit, FlowEdit>() // 流程编辑接口
|
|
|
|
|
|
.Register<IFlowControl, FlowControl>() // 流程控制接口
|
2026-01-27 17:24:19 +08:00
|
|
|
|
.Register<IFlowLibraryService, FlowLibraryService>() // 流程库服务
|
2025-07-08 14:22:41 +08:00
|
|
|
|
.Register<LocalFlowEnvironment>() // 本地环境
|
|
|
|
|
|
.Register<FlowModelService>() // 节点/画布模型服务
|
|
|
|
|
|
.Register<FlowCoreGenerateService>() // 代码生成
|
|
|
|
|
|
.Register<FlowOperationService>() // 流程操作
|
|
|
|
|
|
.Register<NodeMVVMService>() // 节点MVVM服务
|
2025-07-04 15:46:29 +08:00
|
|
|
|
.Build();
|
2025-07-30 11:29:12 +08:00
|
|
|
|
|
|
|
|
|
|
// 设置JSON解析器
|
2025-09-19 23:58:52 +08:00
|
|
|
|
if (JsonHelper.Provider is null)
|
|
|
|
|
|
{
|
|
|
|
|
|
JsonHelper.UseJsonProvider(new NewtonsoftJsonProvider());
|
|
|
|
|
|
}
|
2026-01-27 17:24:19 +08:00
|
|
|
|
|
2025-09-19 23:58:52 +08:00
|
|
|
|
// 默认使用本地环境
|
2026-01-27 17:24:19 +08:00
|
|
|
|
localFlowEnvironment = ioc.Get<LocalFlowEnvironment>();
|
2025-09-19 23:58:52 +08:00
|
|
|
|
currentFlowEnvironmentEvent = ioc.Get<IFlowEnvironmentEvent>();
|
2026-01-27 17:24:19 +08:00
|
|
|
|
currentFlowEnvironment = localFlowEnvironment;
|
|
|
|
|
|
SereinEnv.SetEnv(localFlowEnvironment);
|
2025-09-19 23:58:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 提供上下文操作进行调用
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="operation"></param>
|
|
|
|
|
|
public FlowEnvironment(UIContextOperation operation)
|
|
|
|
|
|
{
|
|
|
|
|
|
ISereinIOC ioc = new SereinIOC();
|
2026-01-27 17:24:19 +08:00
|
|
|
|
ioc.Register<ISereinIOC>(() => ioc) // IOC容器接口
|
|
|
|
|
|
.Register<IFlowEnvironment>(() => this) // 流程环境接口
|
|
|
|
|
|
.Register<IFlowEnvironmentEvent, FlowEnvironmentEvent>() // 流程环境事件接口
|
|
|
|
|
|
.Register<IFlowLibraryService, FlowLibraryService>()
|
|
|
|
|
|
.Register<UIContextOperation>(() => operation) // 流程环境接口
|
2025-09-19 23:58:52 +08:00
|
|
|
|
.Register<IFlowEdit, FlowEdit>() // 流程编辑接口
|
2026-01-27 17:24:19 +08:00
|
|
|
|
.Register<IFlowControl, FlowControl>() // 流程控制接口
|
|
|
|
|
|
.Register<LocalFlowEnvironment>() // 本地环境
|
|
|
|
|
|
.Register<FlowModelService>() // 节点/画布模型服务
|
|
|
|
|
|
.Register<FlowLibraryService>() // 流程库服务
|
|
|
|
|
|
.Register<FlowCoreGenerateService>() // 代码生成
|
|
|
|
|
|
.Register<FlowOperationService>() // 流程操作
|
|
|
|
|
|
.Register<NodeMVVMService>() // 节点MVVM服务
|
|
|
|
|
|
.Build();
|
2025-09-19 23:58:52 +08:00
|
|
|
|
|
|
|
|
|
|
// 设置JSON解析器
|
|
|
|
|
|
if (JsonHelper.Provider is null)
|
|
|
|
|
|
{
|
|
|
|
|
|
JsonHelper.UseJsonProvider(new NewtonsoftJsonProvider());
|
|
|
|
|
|
}
|
2026-01-27 17:24:19 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
// 默认使用本地环境
|
2026-01-27 17:24:19 +08:00
|
|
|
|
localFlowEnvironment = ioc.Get<LocalFlowEnvironment>();
|
2025-07-04 15:46:29 +08:00
|
|
|
|
currentFlowEnvironmentEvent = ioc.Get<IFlowEnvironmentEvent>();
|
2026-01-27 17:24:19 +08:00
|
|
|
|
currentFlowEnvironment = localFlowEnvironment;
|
|
|
|
|
|
SereinEnv.SetEnv(localFlowEnvironment);
|
2024-10-15 21:56:09 +08:00
|
|
|
|
}
|
2024-10-20 12:10:57 +08:00
|
|
|
|
|
2025-05-26 23:55:23 +08:00
|
|
|
|
/// <summary>
|
2026-01-27 17:24:19 +08:00
|
|
|
|
/// 管理当前环境
|
2025-05-26 23:55:23 +08:00
|
|
|
|
/// </summary>
|
2026-01-27 17:24:19 +08:00
|
|
|
|
|
|
|
|
|
|
private LocalFlowEnvironment localFlowEnvironment;
|
2025-03-21 18:26:01 +08:00
|
|
|
|
|
2024-09-22 14:10:13 +08:00
|
|
|
|
/// <summary>
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// 管理当前环境
|
2024-09-22 14:10:13 +08:00
|
|
|
|
/// </summary>
|
2025-03-21 18:26:01 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
private IFlowEnvironment currentFlowEnvironment;
|
2024-09-22 17:37:32 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 管理当前环境事件
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private IFlowEnvironmentEvent currentFlowEnvironmentEvent;
|
2024-09-15 12:15:32 +08:00
|
|
|
|
|
2025-07-04 21:31:07 +08:00
|
|
|
|
private int _loadingProjectFlag = 0; // 使用原子自增代替锁
|
2024-11-02 16:48:40 +08:00
|
|
|
|
/// <summary>
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// 传入false时,将停止数据通知。传入true时,
|
2024-11-02 16:48:40 +08:00
|
|
|
|
/// </summary>
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <param name="value"></param>
|
|
|
|
|
|
public void SetProjectLoadingFlag(bool value)
|
2024-11-02 16:48:40 +08:00
|
|
|
|
{
|
2025-06-02 16:38:37 +08:00
|
|
|
|
Interlocked.Exchange(ref _loadingProjectFlag, value ? 1 : 0);
|
2024-11-02 16:48:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// 判断是否正在加载项目
|
2024-11-02 16:48:40 +08:00
|
|
|
|
/// </summary>
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public bool IsLoadingProject()
|
2024-11-02 16:48:40 +08:00
|
|
|
|
{
|
2025-06-02 16:38:37 +08:00
|
|
|
|
return Interlocked.CompareExchange(ref _loadingProjectFlag, 1, 1) == 1;
|
2024-11-02 16:48:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
2025-07-04 15:46:29 +08:00
|
|
|
|
public IFlowEnvironment CurrentEnv => currentFlowEnvironment;
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public UIContextOperation UIContextOperation => currentFlowEnvironment.UIContextOperation;
|
2025-07-04 21:31:07 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
2025-07-04 21:31:07 +08:00
|
|
|
|
public IFlowEdit FlowEdit => currentFlowEnvironment.FlowEdit;
|
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public IFlowControl FlowControl => currentFlowEnvironment.FlowControl;
|
2026-01-27 17:24:19 +08:00
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public IFlowLibraryService FlowLibraryService => currentFlowEnvironment.FlowLibraryService;
|
2025-06-22 21:53:37 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
2025-07-04 15:46:29 +08:00
|
|
|
|
public ISereinIOC IOC => currentFlowEnvironment.IOC;
|
2025-06-02 16:45:10 +08:00
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public IFlowEnvironmentEvent Event => currentFlowEnvironment.Event;
|
|
|
|
|
|
|
2024-11-02 16:48:40 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public string EnvName => currentFlowEnvironment.EnvName;
|
2024-09-15 12:15:32 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public string ProjectFileLocation => currentFlowEnvironment.EnvName;
|
2024-10-20 12:10:57 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
2025-07-28 12:16:29 +08:00
|
|
|
|
public bool _IsGlobalInterrupt => currentFlowEnvironment._IsGlobalInterrupt;
|
2024-10-10 10:45:53 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public bool IsControlRemoteEnv => currentFlowEnvironment.IsControlRemoteEnv;
|
2024-11-03 18:28:16 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public InfoClass InfoClass { get => currentFlowEnvironment.InfoClass; set => currentFlowEnvironment.InfoClass = value; }
|
2024-11-03 18:28:16 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public RunState FlowState { get => currentFlowEnvironment.FlowState; set => currentFlowEnvironment.FlowState = value; }
|
2024-09-30 02:45:49 +08:00
|
|
|
|
|
2025-07-28 17:38:51 +08:00
|
|
|
|
/* /// <inheritdoc/>
|
2025-06-02 16:38:37 +08:00
|
|
|
|
public void ActivateFlipflopNode(string nodeGuid)
|
2024-09-15 12:15:32 +08:00
|
|
|
|
{
|
2025-07-04 21:31:07 +08:00
|
|
|
|
currentFlowEnvironment.FlowControl.ActivateFlipflopNode(nodeGuid);
|
2025-07-28 17:38:51 +08:00
|
|
|
|
}*/
|
2024-09-15 12:15:32 +08:00
|
|
|
|
|
2025-07-27 23:34:01 +08:00
|
|
|
|
/* /// <inheritdoc/>
|
2025-06-02 16:38:37 +08:00
|
|
|
|
public async Task<(bool, RemoteMsgUtil)> ConnectRemoteEnv(string addres, int port, string token)
|
2024-10-24 23:32:43 +08:00
|
|
|
|
{
|
2025-06-02 16:38:37 +08:00
|
|
|
|
// 连接成功,切换远程环境
|
|
|
|
|
|
(var isConnect, var remoteMsgUtil) = await currentFlowEnvironment.ConnectRemoteEnv(addres, port, token);
|
|
|
|
|
|
if (isConnect)
|
2025-03-22 18:14:48 +08:00
|
|
|
|
{
|
2025-06-02 16:38:37 +08:00
|
|
|
|
|
2025-07-27 23:34:01 +08:00
|
|
|
|
*//* remoteFlowEnvironment ??= new RemoteFlowEnvironment(remoteMsgUtil, this.Event, this.UIContextOperation);
|
|
|
|
|
|
currentFlowEnvironment = remoteFlowEnvironment;*//*
|
2025-03-22 18:14:48 +08:00
|
|
|
|
}
|
2025-06-02 16:38:37 +08:00
|
|
|
|
return (isConnect, remoteMsgUtil);
|
2025-07-27 23:34:01 +08:00
|
|
|
|
}*/
|
2025-03-22 18:14:48 +08:00
|
|
|
|
|
2025-07-28 17:38:51 +08:00
|
|
|
|
/* public async Task<bool> ExitFlowAsync()
|
2025-06-02 16:38:37 +08:00
|
|
|
|
{
|
2025-07-04 21:31:07 +08:00
|
|
|
|
return await currentFlowEnvironment.FlowControl.ExitFlowAsync();
|
2025-07-28 17:38:51 +08:00
|
|
|
|
}*/
|
2024-10-24 23:32:43 +08:00
|
|
|
|
|
2025-07-27 23:34:01 +08:00
|
|
|
|
/* /// <inheritdoc/>
|
2025-06-02 16:38:37 +08:00
|
|
|
|
public void ExitRemoteEnv()
|
2024-09-15 12:15:32 +08:00
|
|
|
|
{
|
2025-06-02 16:38:37 +08:00
|
|
|
|
currentFlowEnvironment.ExitRemoteEnv();
|
|
|
|
|
|
}
|
2024-12-26 00:26:50 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public async Task<FlowEnvInfo> GetEnvInfoAsync()
|
|
|
|
|
|
{
|
|
|
|
|
|
return await currentFlowEnvironment.GetEnvInfoAsync();
|
2025-07-27 23:34:01 +08:00
|
|
|
|
}*/
|
2024-09-17 14:20:27 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
2025-07-30 21:15:07 +08:00
|
|
|
|
public SereinProjectData GetProjectInfoAsync()
|
2024-12-26 22:24:44 +08:00
|
|
|
|
{
|
2025-07-30 21:15:07 +08:00
|
|
|
|
return currentFlowEnvironment.GetProjectInfoAsync();
|
2024-12-26 22:24:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public void LoadLibrary(string dllPath)
|
|
|
|
|
|
{
|
|
|
|
|
|
currentFlowEnvironment.LoadLibrary(dllPath);
|
|
|
|
|
|
}
|
2024-09-15 12:15:32 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public void SaveProject()
|
|
|
|
|
|
{
|
|
|
|
|
|
currentFlowEnvironment.SaveProject();
|
|
|
|
|
|
}
|
2024-09-27 23:47:25 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
2025-07-06 14:34:49 +08:00
|
|
|
|
public void LoadProject(string filePath)
|
2024-09-27 23:47:25 +08:00
|
|
|
|
{
|
2025-07-06 14:34:49 +08:00
|
|
|
|
//if (flowEnvInfo is null) return;
|
2025-06-02 16:38:37 +08:00
|
|
|
|
SetProjectLoadingFlag(false);
|
2025-07-06 14:34:49 +08:00
|
|
|
|
currentFlowEnvironment.LoadProject(filePath);
|
|
|
|
|
|
SetProjectLoadingFlag(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public async Task LoadProjetAsync(string filePath)
|
|
|
|
|
|
{
|
|
|
|
|
|
//if (flowEnvInfo is null) return;
|
|
|
|
|
|
SetProjectLoadingFlag(false);
|
|
|
|
|
|
await currentFlowEnvironment.LoadProjetAsync(filePath);
|
2025-06-02 16:38:37 +08:00
|
|
|
|
SetProjectLoadingFlag(true);
|
2024-09-27 23:47:25 +08:00
|
|
|
|
}
|
2024-09-15 12:15:32 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public bool TryUnloadLibrary(string assemblyName)
|
2025-06-02 15:16:23 +08:00
|
|
|
|
{
|
2025-06-02 16:38:37 +08:00
|
|
|
|
return currentFlowEnvironment.TryUnloadLibrary(assemblyName);
|
2025-06-02 15:16:23 +08:00
|
|
|
|
}
|
2025-06-02 16:38:37 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 输出信息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="message">日志内容</param>
|
|
|
|
|
|
/// <param name="type">日志类别</param>
|
|
|
|
|
|
/// <param name="class">日志级别</param>
|
2025-07-31 23:59:31 +08:00
|
|
|
|
public void WriteLine(InfoType type, string message, InfoClass @class = InfoClass.General)
|
2025-06-02 16:38:37 +08:00
|
|
|
|
{
|
|
|
|
|
|
currentFlowEnvironment.WriteLine(type, message, @class);
|
|
|
|
|
|
}
|
2024-09-24 22:39:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
#region MyRegion
|
|
|
|
|
|
#if false
|
|
|
|
|
|
public async Task<bool> AddInterruptExpressionAsync(string key, string expression)
|
2024-09-24 22:39:43 +08:00
|
|
|
|
{
|
2025-06-02 16:38:37 +08:00
|
|
|
|
return await currentFlowEnvironment.AddInterruptExpressionAsync(key, expression);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-09-24 22:39:43 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
public async Task<(bool, string[])> CheckObjMonitorStateAsync(string key)
|
|
|
|
|
|
{
|
|
|
|
|
|
return await currentFlowEnvironment.CheckObjMonitorStateAsync(key);
|
|
|
|
|
|
}
|
|
|
|
|
|
public async Task<ChannelFlowInterrupt.CancelType> GetOrCreateGlobalInterruptAsync()
|
|
|
|
|
|
{
|
|
|
|
|
|
return await currentFlowEnvironment.InterruptNode();
|
2024-09-24 22:39:43 +08:00
|
|
|
|
}
|
2025-06-02 16:38:37 +08:00
|
|
|
|
|
|
|
|
|
|
public void SetMonitorObjState(string key, bool isMonitor)
|
2024-09-30 02:45:49 +08:00
|
|
|
|
{
|
2025-06-02 16:38:37 +08:00
|
|
|
|
currentFlowEnvironment.SetMonitorObjState(key, isMonitor);
|
2024-09-30 02:45:49 +08:00
|
|
|
|
}
|
2024-09-24 22:39:43 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
public async Task<bool> SetNodeInterruptAsync(string nodeGuid, bool isInterrupt)
|
|
|
|
|
|
{
|
|
|
|
|
|
return await currentFlowEnvironment.SetNodeInterruptAsync(nodeGuid, isInterrupt);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|
2024-10-11 19:31:34 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
#endregion
|
2024-09-24 22:39:43 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
2026-01-27 17:24:19 +08:00
|
|
|
|
public Task StartRemoteServerAsync(int port = 7525)
|
2024-09-24 22:39:43 +08:00
|
|
|
|
{
|
2026-01-27 17:24:19 +08:00
|
|
|
|
|
|
|
|
|
|
throw new NotImplementedException();
|
2025-06-02 16:38:37 +08:00
|
|
|
|
}
|
2024-09-24 22:39:43 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public void SetUIContextOperation(UIContextOperation uiContextOperation)
|
|
|
|
|
|
{
|
2025-07-06 14:34:49 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
currentFlowEnvironment.SetUIContextOperation(uiContextOperation);
|
|
|
|
|
|
}
|
2024-10-15 21:56:09 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public bool TryGetNodeModel(string nodeGuid, out IFlowNode nodeModel)
|
|
|
|
|
|
{
|
|
|
|
|
|
return currentFlowEnvironment.TryGetNodeModel(nodeGuid, out nodeModel);
|
|
|
|
|
|
}
|
2024-10-20 12:10:57 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public bool TryGetDelegateDetails(string libraryName, string methodName, out DelegateDetails del)
|
|
|
|
|
|
{
|
|
|
|
|
|
return currentFlowEnvironment.TryGetDelegateDetails(libraryName, methodName, out del);
|
|
|
|
|
|
}
|
2024-10-20 12:10:57 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public bool TryGetMethodDetailsInfo(string libraryName, string methodName, out MethodDetailsInfo mdInfo)
|
|
|
|
|
|
{
|
|
|
|
|
|
return currentFlowEnvironment.TryGetMethodDetailsInfo(libraryName, methodName, out mdInfo);
|
|
|
|
|
|
}
|
2024-10-20 12:10:57 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public async Task NotificationNodeValueChangeAsync(string nodeGuid, string path, object value)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!IsLoadingProject())
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (currentFlowEnvironment.IsControlRemoteEnv)
|
|
|
|
|
|
{
|
|
|
|
|
|
await currentFlowEnvironment.NotificationNodeValueChangeAsync(nodeGuid, path, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-20 12:10:57 +08:00
|
|
|
|
|
|
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
#region 流程依赖类库的接口
|
2024-10-20 12:10:57 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public bool LoadNativeLibraryOfRuning(string file)
|
|
|
|
|
|
{
|
|
|
|
|
|
return currentFlowEnvironment.LoadNativeLibraryOfRuning(file);
|
|
|
|
|
|
}
|
2024-09-15 12:15:32 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public void LoadAllNativeLibraryOfRuning(string path, bool isRecurrence = true)
|
|
|
|
|
|
{
|
|
|
|
|
|
currentFlowEnvironment.LoadAllNativeLibraryOfRuning(path,isRecurrence);
|
|
|
|
|
|
}
|
2026-01-27 17:24:19 +08:00
|
|
|
|
|
2024-09-15 12:15:32 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
#endregion
|
2024-09-15 12:15:32 +08:00
|
|
|
|
|
2025-06-02 16:38:37 +08:00
|
|
|
|
}
|
2024-09-15 12:15:32 +08:00
|
|
|
|
}
|