Re: [ADVANCED-DOTNET] delegate to genetic method....

2007-03-30 Thread Marc Brooks
> 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. > > >

Re: [ADVANCED-DOTNET] delegate to genetic method....

2007-03-30 Thread Barry Kelly
"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

Re: [ADVANCED-DOTNET] delegate to genetic method....

2007-03-30 Thread Nicholls, Mark
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,

Re: [ADVANCED-DOTNET] delegate to genetic method....

2007-03-30 Thread Barry Kelly
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

Re: [ADVANCED-DOTNET] delegate to genetic method....

2007-03-30 Thread Nicholls, Mark
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

[ADVANCED-DOTNET] delegate to genetic method....

2007-03-30 Thread Mark Nicholls
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