Hi all, I wonder whether there is a possibility to create a dynamic proxy for a class, in a similar manner to Java's dynamic proxy (java.lang.reflect.Proxy), to inject some code for every method called on some object? I would like all method calls to be delgated to some handler (InvocationHandler in Java).
I need this functionality for a web service proxy, which delegates all methods to SoapHttpClientProtocol.Invoke(), but I would like to add some logic here. At present, I modify the automatically generated class, so that all calls are delegated to a new virtual method, _Invoke(), which by default calls SoapHttpClientProtocol.Invoke(), and may be overridden in a derived class. This is simple, but not too elegant (and, of course, needs work when the proxy is updated). Best regards, Marek =================================== This list is hosted by DevelopMentor� http://www.develop.com Some .NET courses you may be interested in: NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles http://www.develop.com/courses/gaspdotnetls View archives and manage your subscription(s) at http://discuss.develop.com
