Mark Nicholls <[EMAIL PROTECTED]> wrote: > I did it long hand....i.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 matter....but I am intrigued.
That's exactly it - you've got to write a class which embodies the steps: 0) Gets constructed with object instance and method name or other distinguishing info 1) Looks up the MethodInfo for the generic method 2) When called, passes in the type arguments to the MethodInfo and instantiates the method 3) Probably caches step 2 and also binds it to a delegate for performance 4) Invokes the method via the delegate If the class is generic, it can be written such that you only write one class per arity (number of parameters) of the delegate. -- 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