Esempio n. 1
0
        public virtual object invokeGetterMethodForField(PropertyInfo field, object obj, ElementInfo info)
        {
            MethodInfo method = null;

            if (info != null && info.hasPreparedInfo())
            {
                method = info.PreparedInfo.IsPresentMethod;
            }
            else
            {
                method = CoderUtils.findIsPresentMethodForField(field, obj.GetType());
            }
            if (method != null)
            {
                if ((bool)method.Invoke(obj, null))
                {
                    return(field.GetValue(obj, null));
                }
                else
                {
                    return(null);
                }
            }
            return(field.GetValue(obj, null));
        }
Esempio n. 2
0
        private void setupAccessors(Type objectClass, PropertyInfo field)
        {
            try
            {
                doSelectMethod = CoderUtils.findDoSelectMethodForField(field, objectClass);
            }
            catch (Exception)
            {
            }

            try
            {
                isSelectedMethod = CoderUtils.findIsSelectedMethodForField(field, objectClass);
            }
            catch (Exception)
            {
            }

            try
            {
                isPresentMethod = CoderUtils.findIsPresentMethodForField(field, objectClass);
            }
            catch (Exception)
            {
            }
        }