// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; namespace NewStuff { // aspect public aspect Trace1 { // pointcut: // any return type, class NewStuff.IntMath, any method name, any arguments // any return type, class NewStuff.DoubleMath, any method name, any arguments pointcut MathTrace() : execution(public static any NewStuff.IntMath.any(..)) || execution(public static any NewStuff.DoubleMath.any(..)); // advice: // before before() : MathTrace() { Console.WriteLine("AOP> Enter " + thisJoinPoint.Signature); } // advice: // after after() : MathTrace() { Console.WriteLine("AOP> Enter " + thisJoinPoint.Signature); } } }