Esempio n. 1
0
        public static FieldDrawer GetObjectDrawer(FieldInfo _fieldInfo)
        {
            FieldDrawer objectDrawer = null;
            Type        type         = null;

            if (!ObjectDrawerUtility.ObjectDrawerForType(_fieldInfo.FieldType, ref objectDrawer, ref type, _fieldInfo.GetHashCode()))
            {
                return(null);
            }
            if (objectDrawer == null)
            {
                objectDrawer = (Activator.CreateInstance(type) as FieldDrawer);
                ObjectDrawerUtility.objectDrawerMap.Add(_fieldInfo.GetHashCode(), objectDrawer);
            }
            objectDrawer.FieldInfo = _fieldInfo;
            return(objectDrawer);
        }
Esempio n. 2
0
        public static ObjectDrawer GetObjectDrawer(FieldInfo field)
        {
            ObjectDrawer objectDrawer = null;
            Type         type         = null;

            if (!ObjectDrawerUtility.ObjectDrawerForType(field.FieldType, ref objectDrawer, ref type, field.GetHashCode()))
            {
                return(null);
            }
            if (objectDrawer == null)
            {
                objectDrawer = (Activator.CreateInstance(type) as ObjectDrawer);
                ObjectDrawerUtility.objectDrawerMap.Add(field.GetHashCode(), objectDrawer);
            }
            objectDrawer.FieldInfo = field;
            return(objectDrawer);
        }
Esempio n. 3
0
        public static FieldDrawer GetObjectDrawer(FieldAttribute attribute)
        {
            FieldDrawer objectDrawer = null;
            Type        type         = null;

            if (!ObjectDrawerUtility.ObjectDrawerForType(attribute.GetType(), ref objectDrawer, ref type, attribute.GetHashCode()))
            {
                return(null);
            }
            if (objectDrawer != null)
            {
                return(objectDrawer);
            }
            objectDrawer           = (Activator.CreateInstance(type) as FieldDrawer);
            objectDrawer.Attribute = attribute;
            ObjectDrawerUtility.objectDrawerMap.Add(attribute.GetHashCode(), objectDrawer);
            return(objectDrawer);
        }