vendredi 26 août 2016

How do I find objects of a certain type in a Class in C#?

I am going to assume that I have to use System.Reflection. However when I want to build an list of type A that have been defined before, how would I build that list?

public TypeA foo;
System.Attribute.GetCustomAttributes?

I'm not really sure how to better phrase the question. I'm just looking to build a list of all the TypeA occurrences in my class.

Thanks!





Aucun commentaire:

Enregistrer un commentaire