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.
 
Back
Top