Beispiel #1
0
        private static void FindObjectTypeAttribute(Type actionType, FieldInfo field)
        {
            ObjectTypeAttribute attribute = CustomAttributeHelpers.GetAttribute <ObjectTypeAttribute>(field);

            if (attribute == null || attribute.get_ObjectType() == null)
            {
                return;
            }
            ActionTargets.AddActionTarget(actionType, new ActionTarget(attribute.get_ObjectType(), field.get_Name(), false));
        }
Beispiel #2
0
        public static Type GetObjectType(object[] attributes, Type defaultType = null)
        {
            ObjectTypeAttribute attribute = CustomAttributeHelpers.GetAttribute <ObjectTypeAttribute>(attributes);

            if (attribute != null)
            {
                return(attribute.get_ObjectType());
            }
            return(defaultType ?? typeof(Object));
        }