From dff9a00fb61263fc7d928a7e5026b95fc9be3e3e Mon Sep 17 00:00:00 2001
From: fengjiayi <12821976+ning_xi@user.noreply.gitee.com>
Date: Mon, 4 Nov 2024 23:30:52 +0800
Subject: [PATCH] =?UTF-8?q?=E5=9C=A8Serein.Library=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E4=BA=86=E5=9F=BA=E7=A1=80=E5=8A=9F=E8=83=BD=E6=A8=A1=E5=9D=97?=
=?UTF-8?q?=EF=BC=8C=E6=9A=82=E6=97=B6=E5=AE=9E=E7=8E=B0=E4=BA=86=E9=94=AE?=
=?UTF-8?q?=E5=80=BC=E5=AF=B9/=E6=95=B0=E7=BB=84=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=E7=9A=84=E5=88=9B=E5=BB=BA=EF=BC=88=E5=8F=AF=E9=85=8D=E5=90=88?=
=?UTF-8?q?JSON=E5=BA=93=E8=BF=9B=E8=A1=8C=E5=BA=8F=E5=88=97=E5=8C=96?=
=?UTF-8?q?=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Library.Core/DynamicContext.cs | 96 ++++++
Library.Framework/DynamicContext.cs | 5 +
Library/Api/IDynamicContext.cs | 5 +
Library/Api/IFlowEnvironment.cs | 6 +-
Library/FlowNode/DelegateDetails.cs | 9 +-
Library/FlowNode/MethodDetails.cs | 7 +-
Library/FlowNode/NodeModelBaseData.cs | 19 --
Library/FlowNode/NodeModelBaseFunc.cs | 74 ++++-
Library/SereinBaseFunction.cs | 108 +++++++
Library/Utils/ArrayHelper.cs | 7 +-
Library/Utils/DynamicObjectHelper.cs | 303 ++++++++++++++++++
.../SerinExpressionEvaluator.cs | 66 ++--
NodeFlow/Env/FlowEnvironment.cs | 175 +++++++---
NodeFlow/FlowStarter.cs | 6 +-
NodeFlow/Model/CompositeConditionNode.cs | 42 ++-
NodeFlow/Model/SingleConditionNode.cs | 2 +-
NodeFlow/Model/SingleExpOpNode.cs | 2 +-
NodeFlow/Model/SingleFlipflopNode.cs | 6 +-
NodeFlow/Tool/FlowLibrary.cs | 74 ++---
NodeFlow/Tool/FlowLibraryManagement.cs | 125 +++++---
NodeFlow/Tool/NodeMethodDetailsHelper.cs | 9 +-
Serein.BaseNode/SereinBaseNodes.cs | 41 ++-
.../ParameterDetailsPropertyGenerator.cs | 1 +
SereinFlow.sln | 6 +
WorkBench/App.xaml.cs | 1 +
WorkBench/MainWindow.xaml | 11 -
WorkBench/MainWindow.xaml.cs | 33 +-
WorkBench/Node/View/ActionNodeControl.xaml.cs | 51 ++-
WorkBench/Node/View/DllControlControl.xaml | 1 -
.../Node/View/FlipflopNodeControl.xaml.cs | 40 ++-
.../Node/Junction/JunctionControlBase.cs | 20 +-
Workbench/Node/NodeControlBase.cs | 7 +-
Workbench/Node/View/ConnectionControl.cs | 297 ++---------------
33 files changed, 1046 insertions(+), 609 deletions(-)
create mode 100644 Library/SereinBaseFunction.cs
create mode 100644 Library/Utils/DynamicObjectHelper.cs
diff --git a/Library.Core/DynamicContext.cs b/Library.Core/DynamicContext.cs
index 735a5f7..8f4eae4 100644
--- a/Library.Core/DynamicContext.cs
+++ b/Library.Core/DynamicContext.cs
@@ -40,6 +40,11 @@ namespace Serein.Library.Core
///
public ConnectionInvokeType NextOrientation { get; set; }
+ ///
+ /// 运行时异常信息
+ ///
+ public Exception ExceptionOfRuning { get; set; }
+
///
/// 每个流程上下文分别存放节点的当前数据
///
@@ -138,6 +143,10 @@ namespace Serein.Library.Core
disposable?.Dispose();
}
}
+ else
+ {
+
+ }
}
foreach (var nodeObj in ContextShareData.Values)
{
@@ -158,5 +167,92 @@ namespace Serein.Library.Core
RunState = RunState.Completion;
}
+
+ private void Dispose(ref IDictionary keyValuePairs)
+ {
+ foreach (var nodeObj in keyValuePairs.Values)
+ {
+ if (nodeObj is null)
+ {
+ continue;
+ }
+
+ if (nodeObj is IDisposable disposable) /* typeof(IDisposable).IsAssignableFrom(nodeObj?.GetType()) &&*/
+ {
+ disposable?.Dispose();
+ }
+ else if (nodeObj is IDictionary tmpDict)
+ {
+ Dispose(ref tmpDict);
+ }
+ else if (nodeObj is ICollection