mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 19:03:29 +08:00
- 在SettingsModel中添加事件相关依赖引用 - 在SettingsPersistence中实现设置加载、保存、删除的事件发送机制 - 添加SettingsDeletedEvent用于通知设置删除操作 - 添加SettingsResetEvent和SettingsResetAllEvent支持设置重置功能 - 在SettingsPersistence中新增ResetAsync和ResetAllAsync方法 - 修改TryApply方法为实例方法并添加设置应用过程的事件通知 - 添加SettingsApplyingEvent和SettingsAppliedEvent跟踪设置应用状态 - [skip ci]
24 lines
620 B
C#
24 lines
620 B
C#
using GFramework.Game.Abstractions.setting;
|
|
|
|
namespace GFramework.Game.setting.events;
|
|
|
|
/// <summary>
|
|
/// 表示设置删除事件
|
|
/// </summary>
|
|
public class SettingsDeletedEvent(Type settingsType) : ISettingsChangedEvent
|
|
{
|
|
/// <summary>
|
|
/// 获取被删除的设置类型
|
|
/// </summary>
|
|
public Type SettingsType { get; } = settingsType;
|
|
|
|
/// <summary>
|
|
/// 获取设置实例,删除事件中返回 null
|
|
/// </summary>
|
|
public ISettingsSection Settings => null!;
|
|
|
|
/// <summary>
|
|
/// 获取删除时间
|
|
/// </summary>
|
|
public DateTime ChangedAt { get; } = DateTime.UtcNow;
|
|
} |