> That can be emulated via the MethodInfo
> approach described in the previous paragraph. With a bit of moderately
> clever design, you could create set of related reusable generic types,
> all with different arity of their Invoke methods, that solves this
> problem in a totally general way.
>
>
>
"Nicholls, Mark" <[EMAIL PROTECTED]> wrote:
> Ah, I just saw in your later message that you want a method pointer
> (i.e. a delegate) which magically instantiates the target method when
> you supply a type argument.
>
> yep
>
> That can be emulated via the MethodInfo
> approach described in the
Ah, I just saw in your later message that you want a method pointer
(i.e. a delegate) which magically instantiates the target method when
you supply a type argument.
yep
That can be emulated via the MethodInfo
approach described in the previous paragraph. With a bit of moderately
clever design,
Mark Nicholls <[EMAIL PROTECTED]> wrote:
> class Bar
> {
>int Foo(X x);
> }
>
> how do I define a single delegate that can refer to Foo?
>
> delegate int FooDelegate(X x);
Sure, that'll work:
---8<---
using System;
class App
{
int Foo(X x)
{
return 0;
}
delega
Sorry.
As usual as clear as mud
The point being that I want to specifify the type parameter on the line
invoking the delegate...
So
FooDelegate x = new FooDelegate(FooMethod);
X(123);
Not
FooDelegate x = new FooDelegate(FooMethod);
X(123);
-Original Message-
From: Discussion o
how?
is it possible...
class Bar
{
int Foo(X x);
}
how do I define a single delegate that can refer to Foo?
delegate int FooDelegate(X x);
almost...not quite.
===
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your su