重写了节点的view、viewmodel关系,实现了对画布元素的选取功能,重构了底层依赖,添加了对net .Framework4.6.1以上的Framework类库支持

This commit is contained in:
fengjiayi
2024-09-12 20:32:54 +08:00
parent ec6e09ced1
commit f286fc644a
120 changed files with 91218 additions and 761 deletions

View File

@@ -0,0 +1,40 @@
using Serein.Library.Api;
using Serein.Library.Utils;
using System;
using System.Threading.Tasks;
namespace Serein.Library.Framework.NodeFlow
{
/// <summary>
/// 动态流程上下文
/// </summary>
public class DynamicContext : IDynamicContext
{
public DynamicContext(ISereinIoc sereinIoc)
{
SereinIoc = sereinIoc;
}
public NodeRunCts NodeRunCts { get; set; }
public ISereinIoc SereinIoc { get; }
public Task CreateTimingTask(Action action, int time = 100, int count = -1)
{
if(NodeRunCts == null)
{
NodeRunCts = SereinIoc.GetOrInstantiate<NodeRunCts>();
}
return Task.Factory.StartNew(async () =>
{
for (int i = 0; i < count; i++)
{
NodeRunCts.Token.ThrowIfCancellationRequested();
await Task.Delay(time);
action.Invoke();
}
});
}
}
}