我们如何在枚举上定义和使用多重描述属性?
public enum EnumWithDescription
{
[CustomDescritption("job-view")]
[Description("analyics-job-view")]
JobView
}
class CustomDescritption: DescriptionAttribute
{
private string extraInfo;
public string ExtraInfo { get { return extraInfo; } set { extraInfo = value; } }
public MyDescritptionAttribute(string description)
{
this.DescriptionValue = description;
this.extraInfo = "";
}
}