public static object Interceptor(JoinPoint jp) { // Console.WriteLine("intercepted : " + jp); object result = jp.Proceed(); // Console.WriteLine("result : " + result); return result; }
public static object AroundTargetMethod(JoinPoint jp) { //~ System.Console.WriteLine("joinpoint : " + jp); object result = jp.Proceed(); //~ System.Console.WriteLine("result : " + result); return result; }
public static object YourMethodCallInterceptor(JoinPoint jp) { Write(++indent, "-> method call [{0}]", jp); object result = jp.Proceed(); Write(indent--, "<- method call [{0}]", jp); return result; }
public static object YourConstructorCallInterceptor(JoinPoint jp) { Write(++indent, "-> constructor call [{0}]", jp); object result = jp.Proceed(); Write(indent--, "<- constructor call [{0}]", jp); return result; }
public static object AroundTargetMethodWithException(JoinPoint jp) { try { return jp.Proceed(); } catch (Exception) { //Silent return null; } }
public static object AroundTargetMethod(JoinPoint jp) { int result = (int)jp.Proceed(); return result * 2; }
public static object Interceptor(JoinPoint jp) { return jp.Proceed(); }