mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 将TypeEventSystem重命名为EventBus - 将IEasyEvent接口重命名为IEvent接口 - 将ITypeEventSystem接口重命名为IEventBus接口 - 更新Architecture类中使用TypeEventSystem为EventBus - 更新ArchitectureContext中依赖注入参数类型 - 将EasyEvent泛型类重命名为Event泛型类 - 更新所有相关类型引用和实现 - 修改接口继承关系以使用新的事件接口命名
36 lines
1.3 KiB
C#
36 lines
1.3 KiB
C#
using System;
|
|
using GFramework.Core.Abstractions.events;
|
|
|
|
namespace GFramework.Core.Abstractions.property;
|
|
|
|
/// <summary>
|
|
/// 只读可绑定属性接口,提供属性值的读取和变更监听功能
|
|
/// </summary>
|
|
/// <typeparam name="T">属性值的类型</typeparam>
|
|
public interface IReadonlyBindableProperty<out T> : IEvent
|
|
{
|
|
/// <summary>
|
|
/// 获取属性的当前值
|
|
/// </summary>
|
|
T Value { get; }
|
|
|
|
/// <summary>
|
|
/// 注册属性值变更回调,并立即执行一次初始值的回调
|
|
/// </summary>
|
|
/// <param name="action">属性值变更时执行的回调函数,参数为新的属性值</param>
|
|
/// <returns>用于取消注册的句柄对象</returns>
|
|
IUnRegister RegisterWithInitValue(Action<T> action);
|
|
|
|
/// <summary>
|
|
/// 取消注册属性值变更回调
|
|
/// </summary>
|
|
/// <param name="onValueChanged">要取消注册的回调函数</param>
|
|
void UnRegister(Action<T> onValueChanged);
|
|
|
|
/// <summary>
|
|
/// 注册属性值变更回调
|
|
/// </summary>
|
|
/// <param name="onValueChanged">属性值变更时执行的回调函数,参数为新的属性值</param>
|
|
/// <returns>用于取消注册的句柄对象</returns>
|
|
IUnRegister Register(Action<T> onValueChanged);
|
|
} |