Exemplo n.º 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);
    }
Exemplo n.º 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);
    }