From a43c611d722a65b6bba72d7d18b1648d6994e72c Mon Sep 17 00:00:00 2001
From: fengjiayi <12821976+ning_xi@user.noreply.gitee.com>
Date: Mon, 2 Jun 2025 15:16:23 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86IOC=E5=AE=B9?=
=?UTF-8?q?=E5=99=A8=E7=9A=84=E5=AE=9E=E7=8E=B0=EF=BC=8C=E4=BD=BF=E5=85=B6?=
=?UTF-8?q?=E6=9B=B4=E5=8A=A0=E8=BD=BB=E9=87=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Library/Api/ISereinIoc.cs | 95 +++---
Library/FlowNode/ParameterDetails.cs | 2 +-
Library/Network/Http/Router.cs | 2 +-
Library/Network/WebSocket/Handle/Attribute.cs | 50 ---
Library/Utils/MsgIdHelper.cs | 58 ++++
Library/Utils/SereinIoc.cs | 287 ++++++++++--------
Net462DllTest/View/FromWorkBenchView.cs | 2 +-
NodeFlow/Env/FlowEnvironment.cs | 104 ++-----
NodeFlow/Env/FlowEnvironmentDecorator.cs | 76 ++---
NodeFlow/FlowWorkManagement.cs | 3 +-
10 files changed, 317 insertions(+), 362 deletions(-)
create mode 100644 Library/Utils/MsgIdHelper.cs
diff --git a/Library/Api/ISereinIoc.cs b/Library/Api/ISereinIoc.cs
index f8f181a..447c320 100644
--- a/Library/Api/ISereinIoc.cs
+++ b/Library/Api/ISereinIoc.cs
@@ -5,106 +5,85 @@ using System.Text;
namespace Serein.Library.Api
{
///
- /// 单例模式IOC容器,内部维护了一个实例字典,默认使用类型的FullName作为Key,如果以“接口-实现类”的方式注册,那么将使用接口类型的FullName作为Key。
+ /// 单例模式IOC容器,内部维护了一个实例字典,默认使用类型的FullName作为Key,
+ /// 如果以“接口-实现类”的方式注册,那么将使用接口类型的FullName作为Key。
/// 当某个类型注册绑定成功后,将不会因为其它地方尝试注册相同类型的行为导致类型被重新创建。
///
- public interface ISereinIOC
+ public interface ISereinIOC
{
///
/// 慎用,重置IOC容器,除非再次注册绑定,否则将导致不能创建注入依赖类的临时对象。
///
///
ISereinIOC Reset();
+
///
- /// 注册实例,如果确定了params,那么将使用params入参构建实例对象。
+ /// 通过指定类型的方式注册实例
///
- ISereinIOC Register(Type type, params object[] parameters);
- ///
- /// 通过泛型的方式注册实例,如果确定了params,那么将使用params入参构建实例对象。
- ///
- ///
- ///
+ /// 实例类型
///
- ISereinIOC Register(params object[] parameters);
+ ISereinIOC Register(Type type);
+
+ ///
+ /// 通过指定类型的方式注册实例
+ ///
+ /// 实例类型
+ /// 获取实例的回调函数
+ ///
+ ISereinIOC Register(Type type, Func