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

2007-04-02 Thread Barry Kelly
Mark Nicholls <[EMAIL PROTECTED]> wrote: > I did it long handi.e. hand wrote a command object with a > parametised 'execute' method... > > I cannot see that dot net has the syntax to do what I want without doing > it explicitly as a class or interface. > > it doesn't matterbut I am intri

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

2007-04-02 Thread Mark Nicholls
I did it long handi.e. hand wrote a command object with a parametised 'execute' method... I cannot see that dot net has the syntax to do what I want without doing it explicitly as a class or interface. it doesn't matterbut I am intrigued. === This list is

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
some minor syntactical thing. Thanks anyway -Original Message- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Barry Kelly Sent: 30 March 2007 17:35 To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Re: [ADVANCED-DOTNET] delegate to genetic method Mar

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
of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Nicholls, Mark Sent: 30 March 2007 17:16 To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: [ADVANCED-DOTNET] delegate to genetic method how? is it possible... class Bar { int Foo(X x); } how do I define a single delegate that

[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