// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; using Castle.DynamicProxy; namespace Dynamic { // aspect public class Trace : IInterceptor { // advice and pointcut defined in interceptor setup public void Intercept(IInvocation inv) { Console.WriteLine("AOP> Enter " + inv.Method); inv.Proceed(); Console.WriteLine("AOP> Exit " + inv.Method); } } }