Пример #1
0
        public override ValueReference GetValueReference(Bindings bindings, ELContext context)
        {
            ValueExpression expression = bindings.GetVariable(index);

            if (expression != null)
            {
                return(expression.GetValueReference(context));
            }
            return(new ValueReference(null, name));
        }
Пример #2
0
        public override void SetValue(Bindings bindings, ELContext context, object value)
        {
            ValueExpression expression = bindings.GetVariable(index);

            if (expression != null)
            {
                expression.SetValue(context, value);
                return;
            }
            context.PropertyResolved = false;
            context.ELResolver.SetValue(context, null, name, value);
            if (!context.PropertyResolved)
            {
                throw new PropertyNotFoundException(LocalMessages.Get("error.identifier.property.notfound", name));
            }
        }
Пример #3
0
        public override object Eval(Bindings bindings, ELContext context)
        {
            ValueExpression expression = bindings.GetVariable(index);

            if (expression != null)
            {
                return(expression.GetValue(context));
            }
            context.PropertyResolved = false;
            object result = context.ELResolver.GetValue(context, null, name);

            if (!context.PropertyResolved)
            {
                throw new PropertyNotFoundException(LocalMessages.Get(string.Format("error.identifier.property.notfound:{0}", name)));
            }
            return(result);
        }
Пример #4
0
        public override bool IsReadOnly(Bindings bindings, ELContext context)
        {
            ValueExpression expression = bindings.GetVariable(index);

            if (expression != null)
            {
                return(expression.IsReadOnly(context));
            }
            context.PropertyResolved = false;
            bool result = context.ELResolver.IsReadOnly(context, null, name);

            if (!context.PropertyResolved)
            {
                throw new PropertyNotFoundException(LocalMessages.Get("error.identifier.property.notfound", name));
            }
            return(result);
        }