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

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