public static object AroundConstructor(MethodJoinPoint jp) { if (jp.NbParameters > 0) { jp[0] = "intercepted " + jp[0]; } return jp.Proceed(); }
public static object ValueProperty(MethodJoinPoint jp) { Console.WriteLine("*** target : {0}", jp.RealTarget); IArgDef adef = jp.RealTarget as IArgDef; if (adef != null) { Console.WriteLine("expression:{0}, argtype:{1}", adef.Expression, adef.ArgType); } object result = jp.Proceed(); return result; }
public static object ValueProperty(MethodJoinPoint jp) { object result = null; IArgDef adef = jp.RealTarget as IArgDef; string expression = adef.Expression; if (expression != null && expression.IndexOf("#") > -1) { Hashtable table = new Hashtable(); table["container"] = adef.Container; table["appSettings"] = ConfigurationManager.AppSettings; result = ExpressionEvaluator.GetValue(null, expression, table); } else { result = jp.Proceed(); } return result; }
public static object AroundStaticConstructor(MethodJoinPoint jp) { object result = jp.Proceed(); B.staticVal *=2; return result; }
public static object AroundNestedClass(MethodJoinPoint jp) { return jp.Proceed(); }
public static object AroundCtor(MethodJoinPoint jp) { jp[0] = " intercepted " + jp[0]; return jp.Proceed(); }
public static object StaticInterceptorMixedTypes(MethodJoinPoint jp) { string s = (string)jp[2]; int i = (int)jp.Proceed(); return s.Length + i; }
public static object AroundExternalCall(MethodJoinPoint jp) { System.Console.Write(""); // To check whether this invocation is excluded (else -> stack overflow) return jp.Proceed(); }
public static object InterceptPorperty(MethodJoinPoint jp) { Console.WriteLine("--- before property get : {0}", jp); return jp.Proceed(); }
public static object AroundTargetMethod(MethodJoinPoint jp) { return jp.Proceed(); }