How can I get the methods of a class that return void?

355 views Asked by At

I need to get the methods with return-type void, something similar to this:

Constructor.

Property.

How can i do a similar thing which tells me the methods whose return-type is void?

1

There are 1 answers

2
NSFW On BEST ANSWER

I suspect that you want to call Type.GetMethods, which returns information about all methods, and then look for results where methodInfo.ReturnType == typeof(void).

http://msdn.microsoft.com/en-us/library/4d848zkb(v=vs.110).aspx