// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; using PostSharp.Laos; [Serializable] public class Trace : OnMethodBoundaryAspect { public override void OnEntry(MethodExecutionEventArgs ctx) { Console.WriteLine("Before " + ctx.Method); } public override void OnExit(MethodExecutionEventArgs ctx) { Console.WriteLine("After " + ctx.Method); } }