jeudi 12 mars 2015

How to create a custom attribute in a property and access by Reflection [duplicate]


This question already has an answer here:




I have a property like this:



[Category("Appearance"),
DisplayName("CustomColor"),
DescriptionAttribute("Custom background color")]
public int BackgroundColorIndex
{
get;
set;
}


I want to create a custom string attribute, like DisplayName and then access its value using Reflection. Is it possible? How could I do something like this?






Aucun commentaire:

Enregistrer un commentaire