Peter van der Weerd <[EMAIL PROTECTED]> wrote:
> Tnanx, You're right of course.
> But I need information about the *signature* of functions a delegate can
> bind to.
There are an infinite number of function signatures that a delegate can
bind to, because of covariance and contravariance.
The basic information about the delegate is on the Invoke method of the
delegate type, like I said:
typeof(MyDelegate).GetMethod("Invoke").GetParameters()
etc.
> > My question is: how can I get information to what type of functions a
> > delegate can bind to.
> > Basically I want to write a function which accepts a typeof(MyDelegate)
> > and
> > is able to check if the MemberInfo of a method is bindable to this
> > delegate.
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.
-- Barry
--
http://barrkel.blogspot.com/
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com