這是我的課:
[AttributeUsage(AttributeTargets.Field)]
public sealed class LabelAttribute : Attribute
{
public LabelAttribute(String labelName)
{
Name = labelName;
}
public String Name { get; set; }
}
,我希望得到的屬性的字段:
public enum ECategory
{
[Label("Safe")]
Safe,
[Label("LetterDepositBox")]
LetterDepositBox,
[Label("SavingsBookBox")]
SavingsBookBox,
}
我想你在功能中缺少參數名 –
@PaoloTedesco固定 – Default