dimanche 30 août 2015

How to get the name of a method at runtime?

I'm using an event system that takes a string for the callback method name. I'd like to avoid hardcoding strings. Is there any way I can get the method names of given class in runtime?

Something similar to:

typeof(MyClass).Name;

but for methods would be perfect.

Edit:

I've been googling the problem and all results seem to be people looking to get the name of the current executing method. This isn't what I'm looking for - instead I'd like to get the name of other methods within the same class.





Aucun commentaire:

Enregistrer un commentaire