mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 19:03:29 +08:00
- 新增 SettingsAllLoadedEvent 事件类,用于表示所有设置加载完成 - 新增 SettingsAppliedEvent 事件类,用于表示设置应用完成状态 - 新增 SettingsApplyingEvent 事件类,用于表示设置正在应用过程 - 新增 SettingsBatchChangedEvent 事件类,用于表示批量设置变更 - 新增 SettingsBatchSavedEvent 事件类,用于表示批量设置保存 - 新增 SettingsChangedEvent 通用设置变更事件类 - 新增 SettingsLoadedEvent 和 SettingsSavedEvent 事件类 - 在 SettingsModel 中添加对 GFramework.Core.extensions 的引用 - 更新 RegisterApplicator 方法支持链式调用并改进注释说明 - 新增 ISettingsChangedEvent 接口定义设置变更事件基础结构 - 修改 ISettingsModel 接口使 RegisterApplicator 方法支持链式调用 - 修改 ISettingsPersistence 接口继承 IContextUtility 接口
30 lines
959 B
C#
30 lines
959 B
C#
using GFramework.Game.Abstractions.setting;
|
||
|
||
namespace GFramework.Game.setting.events;
|
||
|
||
/// <summary>
|
||
/// 表示所有设置已加载完成的事件
|
||
/// </summary>
|
||
/// <param name="all">包含所有设置节的可枚举集合</param>
|
||
public class SettingsAllLoadedEvent(IEnumerable<ISettingsSection> all) : ISettingsChangedEvent
|
||
{
|
||
/// <summary>
|
||
/// 获取所有设置节的只读集合
|
||
/// </summary>
|
||
public IReadOnlyCollection<ISettingsSection> AllSettings { get; } = all.ToList();
|
||
|
||
/// <summary>
|
||
/// 获取设置类型,始终返回 ISettingsSection 类型
|
||
/// </summary>
|
||
public Type SettingsType => typeof(ISettingsSection);
|
||
|
||
/// <summary>
|
||
/// 获取具体的设置节,此事件中始终为 null
|
||
/// </summary>
|
||
public ISettingsSection Settings => null!;
|
||
|
||
/// <summary>
|
||
/// 获取事件发生的时间(UTC时间)
|
||
/// </summary>
|
||
public DateTime ChangedAt { get; } = DateTime.UtcNow;
|
||
} |