// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using Vajhoej.StaticWeaver; namespace Hack { [Aspect] public class Patch { [Pointcut(Signature="* SomeLib.SomeClass::X(*)")] public static void MethodToPatch() { } [BeforeCallAdvice(Pointcut="MethodToPatch")] public static void SkipX(MethodJoinpoint mjp) { Console.WriteLine("Let us skip the call to X"); mjp.SkipCall = true; } } }