3 namespace AopAlliance
.Intercept
6 /// <p>Intercepts calls on an interface on its way to the target. These are nested "on top" of the target.</p>
9 /// <p>The user should implement the <c>Invoke(IMethodInvocation)</c> method to modify the original behavior.</p>
11 /// class TracingInterceptor : IMethodInterceptor
13 /// Object Invoke(IMethodInvocation i)
15 /// Console.WriteLine("Method {0} is called on {1} with args {2}", i.GetMethod(), i.GetThis(), i.GetArguments());
16 /// object ret = i.Proceed();
17 /// Console.WriteLine("Method {0} returned {1}", i.GetMethod(), ret);
25 public interface IMethodInterceptor
: IInterceptor
28 /// Implement this method to perform extra treatments before and after the invocation.
29 /// Polite implementations would certainly like to invoke IJoinpoint.Proceed().
31 /// <param name="invocation">The method invocation joinpoint</param>
32 /// <returns>The result of the call to IJoinpoint.Proceed(), might be intercepted by the interceptor.</returns>
33 /// <exception cref="System.Exception">if the interceptors or the target-object throws an exception.</exception>
34 object Invoke(IMethodInvocation invocation
);