Beamable SDK
|
Struct that defines an attribute of interest and gives us information on where to look for it. More...
Public Member Functions | |
bool | TryGetFromMemberInfo (MemberInfo info, out Attribute attribute) |
Tries to get an attribute from the given member info. Has a guard against passing in members whose MemberInfo.MemberType don't respect INTERNAL_TYPE_SEARCH_WHEN_IS_MEMBER_TYPES. | |
bool | CanBeFoundInType (Type type) |
Checks if the given type should have it's declared members searched for the given attribute. | |
AttributeOfInterest (Type attributeType, Type[] foundInTypesWithAttributes=null, Type[] foundInBaseTypes=null) | |
Constructs a new AttributeOfInterest with guards against incorrect usage. More... | |
Public Attributes | |
readonly Type | AttributeType |
Type of the attribute you are interested in. | |
readonly AttributeTargets | Targets |
Over which types of language constructs the attribute can be found. To use ReflectionCache to find attributes, the attributes MUST have an AttributeUsageAttribute on them. This allows us some performance optimizations to make this interfere less with your editor experience. | |
readonly List< Type > | FoundInBaseTypes |
List of all base types whose implementations we should look through the members to find this attribute. Only relevant if TargetsDeclaredMember returns true. | |
readonly List< Type > | FoundInTypesWithAttributes |
List of all attribute types whose user types (classes/structs that have the attribute over them) we should look through the members to find this attribute. Only relevant if TargetsDeclaredMember returns true. | |
Static Public Attributes | |
const AttributeTargets | INTERNAL_TYPE_SEARCH_WHEN_ATTRIBUTE_TARGETS |
Mask for all possible AttributeTargets declaring an attribute must only exist on a "Member" of classes/structs. More... | |
const MemberTypes | INTERNAL_TYPE_SEARCH_WHEN_IS_MEMBER_TYPES |
Mask for all possible MemberTypes that can be "Members" of declared classes/structs. More... | |
Properties | |
bool | TargetsDeclaredMember [get] |
Whether or not the attribute targets a Non-Type-Member (see INTERNAL_TYPE_SEARCH_WHEN_ATTRIBUTE_TARGETS and INTERNAL_TYPE_SEARCH_WHEN_IS_MEMBER_TYPES). | |
Struct that defines an attribute of interest and gives us information on where to look for it.
|
inline |
Constructs a new AttributeOfInterest with guards against incorrect usage.
attributeType | The Attribute's type. Expects to have AttributeUsageAttribute with correctly declared AttributeTargets. |
foundInTypesWithAttributes | Only relevant when AttributeOfInterest.Targets match INTERNAL_TYPE_SEARCH_WHEN_ATTRIBUTE_TARGETS. List of attributes types whose using types (classes/structs that use the attributes) should be have their members searched for the attributeType . |
foundInBaseTypes | Only relevant when AttributeOfInterest.Targets match INTERNAL_TYPE_SEARCH_WHEN_ATTRIBUTE_TARGETS. List of types whose subclasses should be have their members searched for the attributeType . |
ArgumentException | Thrown if attributeType does not have a AttributeUsageAttribute or if TargetsDeclaredMember and both foundInBaseTypes and foundInTypesWithAttributes have no types. |
|
static |
Mask for all possible AttributeTargets declaring an attribute must only exist on a "Member" of classes/structs.
|
static |
Mask for all possible MemberTypes that can be "Members" of declared classes/structs.