【发布时间】:2011-06-29 07:12:35
【问题描述】:
我想将我的IsGPUBasedAttribute 用于这样的枚举成员:
public enum EffectType
{
[IsGPUBased(true)]
PixelShader,
[IsGPUBased(false)]
Blur
}
但编译器不允许我使用:
[AttributeUsage (AttributeTargets.Enum, AllowMultiple = false)]
什么是正确的AttributeTarget 值来限制枚举成员的使用?
【问题讨论】:
标签: c# .net enums custom-attributes