Exemple #1
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);
    }
Exemple #2
0
    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);
    }
Exemple #3
0
    public static object InterceptPorperty(MethodJoinPoint jp)
    {
        Console.WriteLine("--- before property get : {0}", jp);

        return(jp.Proceed());
    }