2025-07-29 18:36:43 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Serein.Library
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 绑定转换器
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[AttributeUsage(AttributeTargets.Parameter)]
|
|
|
|
|
|
public class BindConvertorAttribute : Attribute
|
|
|
|
|
|
{
|
2025-07-30 21:15:07 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 枚举类型
|
|
|
|
|
|
/// </summary>
|
2025-07-29 18:36:43 +08:00
|
|
|
|
public Type EnumType { get; }
|
2025-07-30 21:15:07 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 转换器类型
|
|
|
|
|
|
/// </summary>
|
2025-07-29 18:36:43 +08:00
|
|
|
|
public Type ConvertorType { get; }
|
|
|
|
|
|
|
2025-07-30 21:15:07 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 绑定转换器特性
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="enum"></param>
|
|
|
|
|
|
/// <param name="convertor"></param>
|
2025-07-29 18:36:43 +08:00
|
|
|
|
public BindConvertorAttribute(Type @enum, Type convertor)
|
|
|
|
|
|
{
|
|
|
|
|
|
EnumType = @enum;
|
|
|
|
|
|
ConvertorType = convertor;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|