Ejemplo n.º 1
0
        public static PropertyInfoAssist GetAssistFromPropertyInfo(PropertyInfo proInfo, Type parentClassType, PropertyInfoAssist.enDirection direction, string path, MethodInfoAssist.enHostType hostType)
        {
            var retValue = new PropertyInfoAssist();

            retValue.Path = path;
            if (proInfo == null)
            {
                return(retValue);
            }
            if (direction == PropertyInfoAssist.enDirection.Set && !proInfo.CanWrite)
            {
                return(retValue);
            }
            if (direction == PropertyInfoAssist.enDirection.Get && !proInfo.CanRead)
            {
                return(retValue);
            }

            retValue.Direction       = direction;
            retValue.PropertyName    = proInfo.Name;
            retValue.PropertyType    = proInfo.PropertyType;
            retValue.ParentClassType = parentClassType;
            retValue.HostType        = hostType;
            return(retValue);
        }
Ejemplo n.º 2
0
        public static PropertyInfoAssist GetAssistFromFieldInfo(FieldInfo fieldInfo, Type parentClassType, PropertyInfoAssist.enDirection direction, string path, MethodInfoAssist.enHostType hostType)
        {
            var retValue = new PropertyInfoAssist();

            retValue.Path = path;
            if (fieldInfo == null)
            {
                return(retValue);
            }

            retValue.Direction       = direction;
            retValue.PropertyName    = fieldInfo.Name;
            retValue.PropertyType    = fieldInfo.FieldType;
            retValue.ParentClassType = parentClassType;
            retValue.IsField         = true;
            retValue.HostType        = hostType;
            return(retValue);
        }