mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-20 00:06:45 +08:00
补充了Library的注释
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Serein.Library.Entity
|
||||
{
|
||||
// 每次发生调用的时候,将当前节点调用信息拷贝一份,
|
||||
// 调用完成后释放?
|
||||
// 参数信息
|
||||
public class CallChainInfo
|
||||
{
|
||||
public List<string> CallGuid { get; }
|
||||
public List<object[]> InvokeData { get; }
|
||||
public List<object> ResultData { get; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -9,7 +9,8 @@ using static Serein.Library.Utils.EmitHelper;
|
||||
namespace Serein.Library.Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 委托描述
|
||||
/// Emit创建的委托描述,用于WebApi、WebSocket、NodeFlow动态调用方法的场景。
|
||||
/// 一般情况下你无须内部细节,只需要调用 Invoke() 方法即可。
|
||||
/// </summary>
|
||||
public class DelegateDetails
|
||||
{
|
||||
@@ -28,6 +29,13 @@ namespace Serein.Library.Entity
|
||||
public Delegate EmitDelegate { get => _emitDelegate; }
|
||||
public EmitMethodType EmitMethodType { get => _emitMethodType; }
|
||||
|
||||
/// <summary>
|
||||
/// 异步等待Emit创建的委托。
|
||||
/// 需要注意的是,传入的实例必须包含创建委托的方法信息,传入的参数也必须符合方法入参信息。
|
||||
/// </summary>
|
||||
/// <param name="instance">实例</param>
|
||||
/// <param name="args">入参</param>
|
||||
/// <returns>返回值</returns>
|
||||
public async Task<object> Invoke(object instance, object[] args)
|
||||
{
|
||||
object result = null;
|
||||
|
||||
@@ -7,12 +7,12 @@ namespace Serein.Library.Entity
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 参数
|
||||
/// 节点入参参数信息
|
||||
/// </summary>
|
||||
public class ExplicitData
|
||||
{
|
||||
/// <summary>
|
||||
/// 索引
|
||||
/// 参数索引
|
||||
/// </summary>
|
||||
public int Index { get; set; }
|
||||
/// <summary>
|
||||
|
||||
@@ -23,67 +23,49 @@ namespace Serein.Library.Entity
|
||||
ActingInstance = ActingInstance,
|
||||
ActingInstanceType = ActingInstanceType,
|
||||
MethodDynamicType = MethodDynamicType,
|
||||
// MethodGuid = Guid.NewGuid().ToString(),
|
||||
MethodTips = MethodTips,
|
||||
ReturnType = ReturnType,
|
||||
MethodName = MethodName,
|
||||
MethodLockName = MethodLockName,
|
||||
IsNetFramework = IsNetFramework,
|
||||
IsProtectionParameter = IsProtectionParameter,
|
||||
ExplicitDatas = ExplicitDatas?.Select(it => it.Clone()).ToArray(),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否保护参数
|
||||
/// 是否保护参数(仅视觉效果参数,不影响运行实现)
|
||||
/// </summary>
|
||||
public bool IsProtectionParameter { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 作用实例的类型
|
||||
/// 作用实例的类型(多个相同的节点将拥有相同的类型)
|
||||
/// </summary>
|
||||
|
||||
public Type ActingInstanceType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 作用实例
|
||||
/// 作用实例(多个相同的节点将会共享同一个实例)
|
||||
/// </summary>
|
||||
|
||||
public object ActingInstance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 方法GUID
|
||||
/// </summary>
|
||||
|
||||
// public string MethodGuid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 方法名称
|
||||
/// </summary>
|
||||
|
||||
public string MethodName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 方法委托
|
||||
/// </summary>
|
||||
// public Delegate MethodDelegate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 节点类型
|
||||
/// </summary>
|
||||
public NodeType MethodDynamicType { get; set; }
|
||||
/// <summary>
|
||||
/// 锁名称
|
||||
/// </summary>
|
||||
|
||||
/// <summary>
|
||||
/// 锁名称(暂未实现)
|
||||
/// </summary>
|
||||
public string MethodLockName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 方法说明
|
||||
/// </summary>
|
||||
|
||||
public string MethodTips { get; set; }
|
||||
|
||||
|
||||
@@ -99,91 +81,7 @@ namespace Serein.Library.Entity
|
||||
|
||||
public Type ReturnType { get; set; }
|
||||
|
||||
public bool IsNetFramework { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//public bool IsCanConnect(Type returnType)
|
||||
//{
|
||||
// if (ExplicitDatas.Length == 0)
|
||||
// {
|
||||
// // 目标不需要传参,可以舍弃结果?
|
||||
// return true;
|
||||
// }
|
||||
// var types = ExplicitDatas.Select(it => it.DataType).ToArray();
|
||||
// // 检查返回类型是否是元组类型
|
||||
// if (returnType.IsGenericType && IsValueTuple(returnType))
|
||||
// {
|
||||
|
||||
// return CompareGenericArguments(returnType, types);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// int index = 0;
|
||||
// if (types[index] == typeof(DynamicContext))
|
||||
// {
|
||||
// index++;
|
||||
// if (types.Length == 1)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// // 被连接节点检查自己需要的参数类型,与发起连接的节点比较返回值类型
|
||||
// if (returnType == types[index])
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// return false;
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// 检查元组类型
|
||||
///// </summary>
|
||||
///// <param name="type"></param>
|
||||
///// <returns></returns>
|
||||
//private bool IsValueTuple(Type type)
|
||||
//{
|
||||
// if (!type.IsGenericType) return false;
|
||||
|
||||
// var genericTypeDef = type.GetGenericTypeDefinition();
|
||||
// return genericTypeDef == typeof(ValueTuple<>) ||
|
||||
// genericTypeDef == typeof(ValueTuple<,>) ||
|
||||
// genericTypeDef == typeof(ValueTuple<,,>) ||
|
||||
// genericTypeDef == typeof(ValueTuple<,,,>) ||
|
||||
// genericTypeDef == typeof(ValueTuple<,,,,>) ||
|
||||
// genericTypeDef == typeof(ValueTuple<,,,,,>) ||
|
||||
// genericTypeDef == typeof(ValueTuple<,,,,,,>) ||
|
||||
// genericTypeDef == typeof(ValueTuple<,,,,,,,>);
|
||||
//}
|
||||
|
||||
//private bool CompareGenericArguments(Type returnType, Type[] parameterTypes)
|
||||
//{
|
||||
// var genericArguments = returnType.GetGenericArguments();
|
||||
// var length = parameterTypes.Length;
|
||||
|
||||
// for (int i = 0; i < genericArguments.Length; i++)
|
||||
// {
|
||||
// if (i >= length) return false;
|
||||
|
||||
// if (IsValueTuple(genericArguments[i]))
|
||||
// {
|
||||
// // 如果当前参数也是 ValueTuple,递归检查嵌套的泛型参数
|
||||
// if (!CompareGenericArguments(genericArguments[i], parameterTypes.Skip(i).ToArray()))
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// else if (genericArguments[i] != parameterTypes[i])
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
|
||||
// return true;
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Serein.Library.Entity
|
||||
{
|
||||
public class NodeData
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,9 @@ using static Serein.Library.Utils.ChannelFlowInterrupt;
|
||||
|
||||
namespace Serein.Library.Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 节点调试设置,用于中断节点的运行
|
||||
/// </summary>
|
||||
public class NodeDebugSetting
|
||||
{
|
||||
/// <summary>
|
||||
@@ -13,32 +16,24 @@ namespace Serein.Library.Entity
|
||||
/// </summary>
|
||||
public bool IsEnable { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 是否监视数据改变
|
||||
/// </summary>
|
||||
// public bool IsMonitorFlowData { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 中断级别,暂时停止继续执行后继分支。
|
||||
/// </summary>
|
||||
public InterruptClass InterruptClass { get; set; } = InterruptClass.None;
|
||||
|
||||
/// <summary>
|
||||
/// 中断表达式
|
||||
/// </summary>
|
||||
// public List<string> InterruptExpressions { get; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// 取消中断的回调函数
|
||||
/// </summary>
|
||||
public Action CancelInterruptCallback { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 中断Task
|
||||
/// 中断Task(用来取消中断)
|
||||
/// </summary>
|
||||
public Func<Task<CancelType>> GetInterruptTask { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 中断级别,暂时停止继续执行后继分支。
|
||||
/// </summary>
|
||||
|
||||
@@ -5,9 +5,16 @@ using System.Text;
|
||||
|
||||
namespace Serein.Library.Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 节点DLL依赖类,如果一个项目中引入了多个DLL,需要放置在同一个文件夹中
|
||||
/// </summary>
|
||||
public class NodeLibrary
|
||||
{
|
||||
/// <summary>
|
||||
/// 路径
|
||||
/// </summary>
|
||||
public string Path { get; set; }
|
||||
|
||||
public Assembly Assembly { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Serein.Library.Entity
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 项目输出文件
|
||||
/// 项目保存文件
|
||||
/// </summary>
|
||||
public class SereinProjectData
|
||||
{
|
||||
@@ -39,11 +39,6 @@ namespace Serein.Library.Entity
|
||||
|
||||
public NodeInfo[] Nodes { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 区域集合
|
||||
///// </summary>
|
||||
|
||||
//public Region[] Regions { get; set; }
|
||||
|
||||
}
|
||||
|
||||
@@ -189,6 +184,9 @@ namespace Serein.Library.Entity
|
||||
public bool IsSelect { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显示参数
|
||||
/// </summary>
|
||||
public class Parameterdata
|
||||
{
|
||||
public bool State { get; set; }
|
||||
@@ -213,13 +211,5 @@ namespace Serein.Library.Entity
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 区域
|
||||
/// </summary>
|
||||
public class Region
|
||||
{
|
||||
public string guid { get; set; }
|
||||
public NodeInfo[] ChildNodes { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user