Look into the documentation. The keyword is TransparentProxy, and it is used in remoting. Remoting requires exactly this (i.e. what you try to achieve), and it does so using this mechanism.
I am sure you can find tons of material on the web to get you started - not that you know what to look for :-) Thomas Tomiczek THONA Software & Consulting Ltd. (Microsoft MVP C#/.NET) (CTO PowerNodes Ltd.) > -----Original Message----- > From: Moderated discussion of advanced .NET topics. > [mailto:[EMAIL PROTECTED] On Behalf Of > Marek Malowidzki > Sent: Sonntag, 21. M�rz 2004 19:32 > To: [EMAIL PROTECTED] > Subject: [ADVANCED-DOTNET] Java's dynamic proxy in .NET? > > 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 > > =================================== 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
