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)); }
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)); }