我有一个枚举,其中一些成员由自定义属性标记,例如:
public enum VideoClipTypeEnum : int
{
Exhibitions = 1,
TV = 2,
[ClipTypeDisplayAttribute(false)]
Content = 3
}
我的属性是:
public class ClipTypeDisplayAttribute : DescriptionAttribute
{
#region Private Variables
private bool _treatAsPublicType;
#endregion
#region Ctor
public ClipTypeDisplayAttribute(bool treatAsPublicType)
{
_treatAsPublicType = treatAsPublicType;
}
#endregion
#region Public Props
public bool TreatAsPublicType
{
get
{
return _treatAsPublicType;
}
set
{
_treatAsPublicType = value;
}
}
#endregion
}
将标记有我的自定义属性的成员值放入列表的最佳方法是什么?