Beispiel #1
0
 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;
	}
Beispiel #4
0
 public static object AroundStaticConstructor(MethodJoinPoint jp)
 {
     object result = jp.Proceed();
     B.staticVal *=2;
     return result;
 }
Beispiel #5
0
 public static object AroundNestedClass(MethodJoinPoint jp)
 {
     return jp.Proceed();
 }
Beispiel #6
0
 public static object AroundCtor(MethodJoinPoint jp)
 {
     jp[0] = " intercepted " + jp[0];
     return jp.Proceed();
 }
Beispiel #7
0
 public static object StaticInterceptorMixedTypes(MethodJoinPoint jp)
 {
     string s = (string)jp[2];
     int i = (int)jp.Proceed();
     return s.Length + i;
 }
Beispiel #8
0
 public static object AroundExternalCall(MethodJoinPoint jp)
 {
     System.Console.Write(""); // To check whether this invocation is excluded (else -> stack overflow)
     return jp.Proceed();
 }
Beispiel #9
0
	public static object InterceptPorperty(MethodJoinPoint jp)
	{
		Console.WriteLine("--- before property get : {0}", jp);

		return jp.Proceed();
	}
Beispiel #10
0
 public static object AroundTargetMethod(MethodJoinPoint jp)
 {
     return jp.Proceed();
 }