mercredi 11 février 2015

How to tell if Type has been generated by the yield return? How to create an instance of this class?



  1. I'm reflecting over an Assembly and there are some types which have been generated by yield return, is there a reliable way to filter them out?




  2. There's no default constructor for the Type generated by yield return. It is a class and not a value type. How to make an instance of this class?




The generated type-name looks like this: SomeNamespace.RootMode+<GetMouseArrow>d__1, where RootMode is the class name and GetMouseArrow is the function which has yield-return in it.






Aucun commentaire:

Enregistrer un commentaire