忘记改啥了*1

This commit is contained in:
fengjiayi
2024-11-02 16:48:40 +08:00
parent 0088d32f12
commit cd1642dcf7
45 changed files with 1022 additions and 447 deletions

View File

@@ -1,6 +1,7 @@
using Serein.Library.Api;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
namespace Serein.Library.Framework.NodeFlow
{
@@ -29,6 +30,11 @@ namespace Serein.Library.Framework.NodeFlow
/// </summary>
public RunState RunState { get; set; } = RunState.NoStart;
/// <summary>
/// 用来在当前流程上下文间传递数据
/// </summary>
public Dictionary<string, object> ContextShareData { get; } = new Dictionary<string, object>();
/// <summary>
/// 当前节点执行完成后,设置该属性,让运行环境判断接下来要执行哪个分支的节点。
/// </summary>
@@ -132,7 +138,22 @@ namespace Serein.Library.Framework.NodeFlow
}
}
}
foreach (var nodeObj in ContextShareData.Values)
{
if (nodeObj is null)
{
continue;
}
else
{
if (typeof(IDisposable).IsAssignableFrom(nodeObj?.GetType()) && nodeObj is IDisposable disposable)
{
disposable?.Dispose();
}
}
}
this.dictNodeFlowData?.Clear();
this.ContextShareData?.Clear();
RunState = RunState.Completion;
}
// public NodeRunCts NodeRunCts { get; set; }

View File

@@ -50,8 +50,8 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="NodeFlow\FlipflopContext.cs" />
<Compile Include="NodeFlow\DynamicContext.cs" />
<Compile Include="FlipflopContext.cs" />
<Compile Include="DynamicContext.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net45" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net462" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net461" />
</packages>