Tales from the Evil Empire

Bertrand Le Roy's blog

News


Bertrand Le Roy

BoudinFatal's Gamercard

Tales from the Evil Empire - Blogged

Blogs I read

My other stuff

Archives

How to reflect over a delegate’s signature

I’ve done some tricky work with delegates recently and I’ve had a hard time trying to reflect over the signature of a delegate type. I feel a little silly now that the solution to this has been provided to me by Eric Lippert. It’s actually quite simple, just reflect over the Invoke method:

MethodInfo invoke = typeof(Func<string, bool>).GetMethod("Invoke");
Console.WriteLine(invoke.ReturnType.Name);

I hope this helps others…

Posted: Jan 23 2009, 02:41 PM by Bertrand Le Roy | with 1 comment(s)
Filed under: ,

Comments

David Maltby said:

Thanks!  That was helpful.

# April 3, 2009 3:50 PM