Type of delegate?

  • Thread starter Thread starter Jon Shemitz
  • Start date Start date
J

Jon Shemitz

Imagine you have a Type value - how can you tell if it's a delegate?
If it's NOT a class, a struct, an enum, or an interface?
 
Brock said:
Type t = GetDelegateType();
if (typeof(Delegate).IsAssignableFrom(t))
{
// Yes, Jim we have a delegate.... :)
}

Yes, thanks, that's what I came up with soon after posting. I was
expecting something like IsClass and IsEnum ....
 

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