vendredi 27 mars 2020

C# reflection and group variables

I am not sure yet what is the best way to do this, I found that you can assign attributes to a class but there is no way to assign an attribute to a variable of the class.

Example [attribute author....] public class ABC int variable1;

what I am looking for is to assign an attribute to variable1.

so something like this

[attribute author....] public class ABC [attribute or something to tie to variable1] int variable1;

so when I use reflection to access the class, I can get additional information from each variable. The reason for this is that I am creating an editor and I want to group variables in the editor but I don't want to hard code the variable names or keep a list of variables that should be grouped.

Any idea how to make something like that?





Aucun commentaire:

Enregistrer un commentaire