diff --git a/Library.Framework/Serein.Library.Framework.1.0.0.nupkg b/Library.Framework/Serein.Library.Framework.1.0.0.nupkg
deleted file mode 100644
index 39614c0..0000000
Binary files a/Library.Framework/Serein.Library.Framework.1.0.0.nupkg and /dev/null differ
diff --git a/Library.Framework/Serein.Library.Framework.nuspec b/Library.Framework/Serein.Library.Framework.nuspec
deleted file mode 100644
index 2b0cebb..0000000
--- a/Library.Framework/Serein.Library.Framework.nuspec
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
- Serein.Library.Framework
- 1.0.0
- fengjiayi
- fengjiayi
- false
- MIT
-
- https://github.com/fhhyyp/serein-flow
- 基于WPF(Dotnet 8)的流程可视化编辑器的依赖库
- $copyright$
- SereinFow
-
-
\ No newline at end of file
diff --git a/Library/Entity/Base/NodeModelBaseData.cs b/Library/Entity/Base/NodeModelBaseData.cs
deleted file mode 100644
index b85c0dc..0000000
--- a/Library/Entity/Base/NodeModelBaseData.cs
+++ /dev/null
@@ -1,225 +0,0 @@
-using Serein.Library.Api;
-using Serein.Library.Entity;
-using Serein.Library.Enums;
-using System;
-using System.Collections.Generic;
-using System.Threading;
-
-namespace Serein.NodeFlow.Base
-{
- ///
- /// 节点基类(数据):条件控件,动作控件,条件区域,动作区域
- ///
- public abstract partial class NodeModelBase : IDynamicFlowNode
- {
-
- public NodeModelBase()
- {
- PreviousNodes = [];
- SuccessorNodes = [];
- foreach (ConnectionType ctType in NodeStaticConfig.ConnectionTypes)
- {
- PreviousNodes[ctType] = new List();
- SuccessorNodes[ctType] = new List();
- }
- DebugSetting = new NodeDebugSetting();
- }
-
-
- ///
- /// 调试功能
- ///
- public NodeDebugSetting DebugSetting { get; set; }
-
- ///
- /// 节点对应的控件类型
- ///
- public NodeControlType ControlType { get; set; }
-
- ///
- /// 方法描述,对应DLL的方法
- ///
- public MethodDetails MethodDetails { get; set; }
-
- ///
- /// 节点guid
- ///
- public string Guid { get; set; }
-
- ///
- /// 显示名称
- ///
- public string DisplayName { get; set; } = string.Empty;
-
- ///
- /// 是否为起点控件
- ///
- public bool IsStart { get; set; }
-
- ///
- /// 运行时的上一节点
- ///
- public NodeModelBase PreviousNode { get; set; }
-
- ///
- /// 不同分支的父节点
- ///
- public Dictionary> PreviousNodes { get; }
-
- ///
- /// 不同分支的子节点
- ///
- public Dictionary> SuccessorNodes { get; }
-
- ///
- /// 当前节点执行完毕后需要执行的下一个分支的类别
- ///
- public ConnectionType NextOrientation { get; set; } = ConnectionType.None;
-
- ///
- /// 运行时的异常信息(仅在 FlowState 为 Error 时存在对应值)
- ///
- public Exception RuningException { get; set; } = null;
-
-
- ///
- /// 控制FlowData在同一时间只会被同一个线程更改。
- ///
- private readonly ReaderWriterLockSlim _flowDataLock = new ReaderWriterLockSlim();
- private object _flowData;
- ///
- /// 当前传递数据(执行了节点对应的方法,才会存在值)。
- ///
- protected object FlowData
- {
- get
- {
- _flowDataLock.EnterReadLock();
- try
- {
- return _flowData;
- }
- finally
- {
- _flowDataLock.ExitReadLock();
- }
- }
- set
- {
- _flowDataLock.EnterWriteLock();
- try
- {
- _flowData = value;
- }
- finally
- {
- _flowDataLock.ExitWriteLock();
- }
- }
- }
-
- }
-
-
-
-
-
- ///
- /// 节点基类(数据):条件控件,动作控件,条件区域,动作区域
- ///
- //public class NodeModelBaseBuilder
- //{
- // public NodeModelBaseBuilder(NodeModelBase builder)
- // {
- // this.ControlType = builder.ControlType;
- // this.MethodDetails = builder.MethodDetails;
- // this.Guid = builder.Guid;
- // this.DisplayName = builder.DisplayName;
- // this.IsStart = builder.IsStart;
- // this.PreviousNode = builder.PreviousNode;
- // this.PreviousNodes = builder.PreviousNodes;
- // this.SucceedBranch = builder.SucceedBranch;
- // this.FailBranch = builder.FailBranch;
- // this.ErrorBranch = builder.ErrorBranch;
- // this.UpstreamBranch = builder.UpstreamBranch;
- // this.FlowState = builder.FlowState;
- // this.RuningException = builder.RuningException;
- // this.FlowData = builder.FlowData;
- // }
-
-
-
- // ///
- // /// 节点对应的控件类型
- // ///
- // public NodeControlType ControlType { get; }
-
- // ///
- // /// 方法描述,对应DLL的方法
- // ///
- // public MethodDetails MethodDetails { get; }
-
- // ///
- // /// 节点guid
- // ///
- // public string Guid { get; }
-
- // ///
- // /// 显示名称
- // ///
- // public string DisplayName { get;}
-
- // ///
- // /// 是否为起点控件
- // ///
- // public bool IsStart { get; }
-
- // ///
- // /// 运行时的上一节点
- // ///
- // public NodeModelBase? PreviousNode { get; }
-
- // ///
- // /// 上一节点集合
- // ///
- // public List PreviousNodes { get; } = [];
-
- // ///
- // /// 下一节点集合(真分支)
- // ///
- // public List SucceedBranch { get; } = [];
-
- // ///
- // /// 下一节点集合(假分支)
- // ///
- // public List FailBranch { get; } = [];
-
- // ///
- // /// 异常分支
- // ///
- // public List ErrorBranch { get; } = [];
-
- // ///
- // /// 上游分支
- // ///
- // public List UpstreamBranch { get; } = [];
-
- // ///
- // /// 当前执行状态(进入真分支还是假分支,异常分支在异常中确定)
- // ///
- // public FlowStateType FlowState { get; set; } = FlowStateType.None;
-
- // ///
- // /// 运行时的异常信息(仅在 FlowState 为 Error 时存在对应值)
- // ///
- // public Exception RuningException { get; set; } = null;
-
- // ///
- // /// 当前传递数据(执行了节点对应的方法,才会存在值)
- // ///
- // public object? FlowData { get; set; } = null;
- //}
-
-
-}
-
diff --git a/Library/Entity/Base/NodeModelBaseFunc.cs b/Library/Entity/Base/NodeModelBaseFunc.cs
deleted file mode 100644
index 610b7fd..0000000
--- a/Library/Entity/Base/NodeModelBaseFunc.cs
+++ /dev/null
@@ -1,457 +0,0 @@
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using Serein.Library.Api;
-using Serein.Library.Attributes;
-using Serein.Library.Entity;
-using Serein.Library.Enums;
-using Serein.Library.Ex;
-using Serein.Library.Utils;
-using Serein.NodeFlow.Tool;
-using Serein.NodeFlow.Tool.SereinExpression;
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-using System.Linq.Expressions;
-using System.Net.Http.Headers;
-using System.Reflection;
-using System.Text;
-using System.Threading.Tasks;
-using System.Xml.Linq;
-using static Serein.Library.Utils.ChannelFlowInterrupt;
-
-namespace Serein.NodeFlow.Base
-{
-
- ///
- /// 节点基类(数据):条件控件,动作控件,条件区域,动作区域
- ///
- public abstract partial class NodeModelBase : IDynamicFlowNode
- {
-
-
- #region 调试中断
-
-
- ///
- /// 不再中断
- ///
- public void CancelInterrupt()
- {
- this.DebugSetting.InterruptClass = InterruptClass.None;
- DebugSetting.CancelInterruptCallback?.Invoke();
- }
-
- #endregion
-
- #region 导出/导入项目文件节点信息
-
- internal abstract Parameterdata[] GetParameterdatas();
- public virtual NodeInfo ToInfo()
- {
- // if (MethodDetails == null) return null;
-
- var trueNodes = SuccessorNodes[ConnectionType.IsSucceed].Select(item => item.Guid); // 真分支
- var falseNodes = SuccessorNodes[ConnectionType.IsFail].Select(item => item.Guid);// 假分支
- var errorNodes = SuccessorNodes[ConnectionType.IsError].Select(item => item.Guid);// 异常分支
- var upstreamNodes = SuccessorNodes[ConnectionType.Upstream].Select(item => item.Guid);// 上游分支
-
- // 生成参数列表
- Parameterdata[] parameterData = GetParameterdatas();
-
- return new NodeInfo
- {
- Guid = Guid,
- MethodName = MethodDetails?.MethodName,
- Label = DisplayName ?? "",
- Type = this.GetType().ToString(),
- TrueNodes = trueNodes.ToArray(),
- FalseNodes = falseNodes.ToArray(),
- UpstreamNodes = upstreamNodes.ToArray(),
- ParameterData = parameterData.ToArray(),
- ErrorNodes = errorNodes.ToArray(),
-
- };
- }
-
- public virtual NodeModelBase LoadInfo(NodeInfo nodeInfo)
- {
- this.Guid = nodeInfo.Guid;
- if (this.MethodDetails is not null)
- {
- for (int i = 0; i < nodeInfo.ParameterData.Length; i++)
- {
- Parameterdata? pd = nodeInfo.ParameterData[i];
- this.MethodDetails.ParameterDetailss[i].IsExplicitData = pd.State;
- this.MethodDetails.ParameterDetailss[i].DataValue = pd.Value;
- }
- }
-
- return this;
- }
-
- #endregion
-
- #region 节点方法的执行
-
- ///
- /// 是否应该退出执行
- ///
- ///
- ///
- ///
- public static bool IsBradk(IDynamicContext context, CancellationTokenSource? flowCts)
- {
- // 上下文不再执行
- if(context.RunState == RunState.Completion)
- {
- return true;
- }
-
- // 不存在全局触发器时,流程运行状态被设置为完成,退出执行,用于打断无限循环分支。
- if (flowCts is null && context.Env.FlowState == RunState.Completion)
- {
- return true;
- }
- // 如果存在全局触发器,且触发器的执行任务已经被取消时,退出执行。
- if (flowCts is not null)
- {
- if (flowCts.IsCancellationRequested)
- return true;
- }
- return false;
- }
-
-
-
- ///
- /// 开始执行
- ///
- ///
- ///
- public async Task StartFlowAsync(IDynamicContext context)
- {
- Stack stack = new Stack();
- stack.Push(this);
- var flowCts = context.Env.IOC.Get(FlowStarter.FlipFlopCtsName);
- bool hasFlipflow = flowCts != null;
- while (stack.Count > 0) // 循环中直到栈为空才会退出循环
- {
- await Task.Delay(0);
- // 从栈中弹出一个节点作为当前节点进行处理
- var currentNode = stack.Pop();
-
- #region 执行相关
-
- // 筛选出上游分支
- var upstreamNodes = currentNode.SuccessorNodes[ConnectionType.Upstream].ToArray();
- for (int index = 0; index < upstreamNodes.Length; index++)
- {
- NodeModelBase? upstreamNode = upstreamNodes[index];
- if (upstreamNode is not null && upstreamNode.DebugSetting.IsEnable)
- {
- if (upstreamNode.DebugSetting.InterruptClass != InterruptClass.None) // 执行触发前
- {
- var cancelType = await upstreamNode.DebugSetting.GetInterruptTask();
- await Console.Out.WriteLineAsync($"[{upstreamNode.MethodDetails?.MethodName}]中断已{cancelType},开始执行后继分支");
- }
- upstreamNode.PreviousNode = currentNode;
- await upstreamNode.StartFlowAsync(context); // 执行流程节点的上游分支
- if (upstreamNode.NextOrientation == ConnectionType.IsError)
- {
- // 如果上游分支执行失败,不再继续执行
- // 使上游节点(仅上游节点本身,不包含上游节点的后继节点)
- // 具备通过抛出异常中断流程的能力
- break;
- }
- }
- }
- if (IsBradk(context, flowCts)) break; // 退出执行
- // 上游分支执行完成,才执行当前节点
- object? newFlowData = await currentNode.ExecutingAsync(context);
- if (IsBradk(context, flowCts)) break; // 退出执行
-
- await RefreshFlowDataAndExpInterrupt(context, currentNode, newFlowData); // 执行当前节点后刷新数据
- #endregion
-
-
- #region 执行完成
-
- // 选择后继分支
- var nextNodes = currentNode.SuccessorNodes[currentNode.NextOrientation];
-
- // 将下一个节点集合中的所有节点逆序推入栈中
- for (int i = nextNodes.Count - 1; i >= 0; i--)
- {
- // 筛选出启用的节点的节点
- if (nextNodes[i].DebugSetting.IsEnable)
- {
- nextNodes[i].PreviousNode = currentNode;
- stack.Push(nextNodes[i]);
- }
- }
-
- #endregion
-
- }
- }
-
-
- ///
- /// 执行节点对应的方法
- ///
- /// 流程上下文
- /// 节点传回数据对象
- public virtual async Task