Calling a method in an interceptable object from itself

Topics: Policy Injection Application Block
Dec 4, 2007 at 3:21 PM
I´m calling from a client object a public method A of an interceptable object. This method A, sometimes calls another public method B of itself (in the way Me.B()) but only under certain circumstances. By intercepting the method calls of the interceptable object, I want to measure the elapsed time of each call, to method A or method B even when method B is called from method A.
The problem is that, it doesn´t matter if the method A finally calls method B or not. I can only measure the elapsed time of method A, but not of method B.
Can anyone give me a hand ?
Thanks in advance.
Javier.
Dec 10, 2007 at 9:06 PM
Hi,

You will have to invoke the method on this through a wrapped reference. Here's a related thread where a similar situation is described: http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=18069.

Hope this helps,
Fernando