mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 实现了 IConfigurationManager 接口定义配置管理契约 - 创建 ConfigurationManager 类提供线程安全的配置存储和访问 - 添加配置的增删改查功能支持泛型类型转换 - 实现配置变更监听机制和取消注册功能 - 提供 JSON 格式导入导出和文件读写功能 - 添加完整的单元测试覆盖并发场景和边界条件 - 实现 ConfigWatcherUnRegister 类处理监听器注销逻辑
21 lines
528 B
C#
21 lines
528 B
C#
using GFramework.Core.Abstractions.events;
|
|
|
|
namespace GFramework.Core.Abstractions.configuration;
|
|
|
|
/// <summary>
|
|
/// 配置监听取消注册接口
|
|
/// </summary>
|
|
internal sealed class ConfigWatcherUnRegister : IUnRegister
|
|
{
|
|
private readonly Action _unRegisterAction;
|
|
|
|
public ConfigWatcherUnRegister(Action unRegisterAction)
|
|
{
|
|
_unRegisterAction = unRegisterAction ?? throw new ArgumentNullException(nameof(unRegisterAction));
|
|
}
|
|
|
|
public void UnRegister()
|
|
{
|
|
_unRegisterAction();
|
|
}
|
|
} |