mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
1. 重新设计了Generate项目及相关特性的命名,避免与其他类型混淆。
2. 补充了部分注释。 3. 修改了删除容器节点时,容器内子节点未正确删除的问题。
This commit is contained in:
@@ -7,11 +7,20 @@ using System.Reflection.Emit;
|
||||
namespace Serein.NodeFlow.Tool
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 动态创建对象的帮助类,支持根据属性字典创建对象并设置属性值。
|
||||
/// </summary>
|
||||
public class ObjDynamicCreateHelper
|
||||
{
|
||||
// 类型缓存,键为类型的唯一名称(可以根据实际需求调整生成方式)
|
||||
static Dictionary<string, Type> typeCache = new Dictionary<string, Type>();
|
||||
|
||||
/// <summary>
|
||||
/// 根据属性字典和类型名称创建对象实例,并设置属性值。
|
||||
/// </summary>
|
||||
/// <param name="properties"></param>
|
||||
/// <param name="typeName"></param>
|
||||
/// <returns></returns>
|
||||
public static object Resolve(Dictionary<string, object> properties, string typeName)
|
||||
{
|
||||
var obj = CreateObjectWithProperties(properties, typeName);
|
||||
|
||||
Reference in New Issue
Block a user