mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-23 03:04:29 +08:00
- 将架构相关接口从 GFramework.Core 迁移至 GFramework.Core.Abstractions 项目 - 更新项目引用配置,添加对抽象层项目的项目引用 - 修正命名空间引用,使用新的抽象层命名空间 - 调整类型定义,将 List<T> 替换为更通用的 IList<T> 接口 - 修复控制器接口命名空间错误 - 添加必要的 using 语句以支持新的抽象层引用
22 lines
627 B
C#
22 lines
627 B
C#
using GFramework.Core.Abstractions.events;
|
|
|
|
namespace GFramework.Core.events;
|
|
|
|
/// <summary>
|
|
/// 默认注销器类,用于执行注销操作
|
|
/// </summary>
|
|
/// <param name="onUnRegister">注销时要执行的回调函数</param>
|
|
public class DefaultUnRegister(Action onUnRegister) : IUnRegister
|
|
{
|
|
private Action _mOnUnRegister = onUnRegister;
|
|
|
|
/// <summary>
|
|
/// 执行注销操作,调用注册的回调函数并清理引用
|
|
/// </summary>
|
|
public void UnRegister()
|
|
{
|
|
// 调用注销回调函数并清理引用
|
|
_mOnUnRegister.Invoke();
|
|
_mOnUnRegister = null;
|
|
}
|
|
} |