-3

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?

leppie
  • 115,091
  • 17
  • 196
  • 297
  • Are you looking for a way to get *methods whose return type is void?* – NSFW Nov 15 '14 at 21:14
  • And what do you mean by "the voids of a *script*?" – NSFW Nov 15 '14 at 21:15
  • Answer to 1 and 2. ya i mean all method return void, public void voidA (){} public void voidB (){} public void voidC (){} i want a list as following voidA, voidB, voidC – John Stevenin Nov 16 '14 at 15:06

1 Answers1

1

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

NSFW
  • 557
  • 4
  • 12
  • ya exactly that, awesome, and another question how can i call this method after by using this? public void callVoid (params object[] obj) { target.GetType ().GetMethods (...).call (obj); } – John Stevenin Nov 16 '14 at 15:09
  • Sorry, i am new to coding, just from a couple of months, and i don't know how to express what i want in code language, sorry. – John Stevenin Nov 16 '14 at 15:10