mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
上传了新的示例工程
This commit is contained in:
@@ -73,6 +73,30 @@ namespace Serein.Library.Attributes
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 枚举值转换器,要求枚举项标记的BindValueAttribute特性,与搭配的参数类型一致,否则参数不会传入
|
||||
/// </summary>
|
||||
|
||||
[AttributeUsage(AttributeTargets.Parameter)]
|
||||
public class EnumTypeConvertorAttribute : Attribute
|
||||
{
|
||||
public Type EnumType { get; }
|
||||
|
||||
public EnumTypeConvertorAttribute(Type @enum)
|
||||
{
|
||||
if (@enum.IsEnum)
|
||||
{
|
||||
EnumType = @enum;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("需要枚举类型");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
public class PLCValueAttribute : Attribute
|
||||
{
|
||||
@@ -121,27 +145,4 @@ namespace Serein.Library.Attributes
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 枚举值转换器
|
||||
/// </summary>
|
||||
|
||||
//[AttributeUsage(AttributeTargets.Parameter)]
|
||||
//public class EnumConvertorAttribute : Attribute
|
||||
//{
|
||||
// public Type Enum { get; }
|
||||
|
||||
// public EnumConvertorAttribute(Type @enum)
|
||||
// {
|
||||
// if (@enum.IsEnum)
|
||||
// {
|
||||
// Enum = @enum;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// throw new ArgumentException("需要枚举类型");
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user