mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-23 03:04:29 +08:00
- 将 OnPauseStateChanged 事件从 Action<PauseGroup, bool> 类型改为 EventHandler<PauseStateChangedEventArgs> - 添加 PauseStateChangedEventArgs 类来封装事件数据 - 更新所有事件处理方法的签名以匹配新的事件参数 - 修改文档中相关的事件处理代码示例 - 在 PauseStackManager 中添加 RaisePauseStateChanged 方法统一处理事件触发 - 更新测试代码以适应新的事件处理方式
30 lines
1.0 KiB
C#
30 lines
1.0 KiB
C#
namespace GFramework.Core.Abstractions.Pause;
|
|
|
|
/// <summary>
|
|
/// 表示暂停状态变化事件的数据。
|
|
/// 该类型用于向事件订阅者传递暂停组以及该组变化后的暂停状态。
|
|
/// </summary>
|
|
public sealed class PauseStateChangedEventArgs : EventArgs
|
|
{
|
|
/// <summary>
|
|
/// 初始化 <see cref="PauseStateChangedEventArgs"/> 的新实例。
|
|
/// </summary>
|
|
/// <param name="group">发生状态变化的暂停组。</param>
|
|
/// <param name="isPaused">暂停组变化后的新状态。</param>
|
|
public PauseStateChangedEventArgs(PauseGroup group, bool isPaused)
|
|
{
|
|
Group = group;
|
|
IsPaused = isPaused;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取发生状态变化的暂停组。
|
|
/// </summary>
|
|
public PauseGroup Group { get; }
|
|
|
|
/// <summary>
|
|
/// 获取暂停组变化后的新状态。
|
|
/// 为 <see langword="true"/> 表示进入暂停,为 <see langword="false"/> 表示恢复运行。
|
|
/// </summary>
|
|
public bool IsPaused { get; }
|
|
} |