getting type of delegate parameters by reflection.

  • Thread starter Thread starter J?r?me P?query
  • Start date Start date
J

J?r?me P?query

I use .NET reflection to get information about assemblies, and I have
a proble with delegates with types parameter like :

delegate void MyDelegate (int a, double b);

Visiting my assembly, I can get all type (as System.Type), and some of
them are delegates (they extends System.MulticastDelegate, if there is
a better solution, I'm interrested).

Now, I want to retrieve the returnType and the parameter list. Just
like for methods, I would prefer to find ParameterInfo, because I can
already visit this kind of type, but I'm interrested by any way to do.

Thanks in advance.

J. Péquery
 
J?r?me P?query said:
I use .NET reflection to get information about assemblies, and I have
a proble with delegates with types parameter like :

delegate void MyDelegate (int a, double b);

Visiting my assembly, I can get all type (as System.Type), and some of
them are delegates (they extends System.MulticastDelegate, if there is
a better solution, I'm interrested).

Now, I want to retrieve the returnType and the parameter list. Just
like for methods, I would prefer to find ParameterInfo, because I can
already visit this kind of type, but I'm interrested by any way to do.

Just get look at the Invoke method of the delegate type, and treat it
as any other method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top