> Like this?  (tested in GMail, just wondering?)
>

[snip: use of IsAssignableFrom for return & argument type compatibility]

Exactly, although I'm not 100% sure what all the minute rules of delegate
compatability are now, so I punted :-)

Having caught up on the thread, I actually like like Barry's suggestion
better than mine:

[Barry Kelly]
> The easiest way is to use one of the Delegate.CreateDelegate() overloads
> which accepts a "throwOnBindFailure" and pass false; and test for a null
> return value.

I'd lean towards that approach over mine, because it delegates (pun
intended) the actual compatibility check to the CLR - so you get an answer
right from the horse's mouth.  If/as the rules of compatibility change, your
code will stay in sync with whatever those rules happen to be over time.

-Mike
Bear Canyon Consulting LLC
http://www.bearcanyon.com
http://www.pluralsight.com/mike

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to