Class fsPortableReflection
This wraps reflection types so that it is portable across different Unity
runtimes.
Inheritance
fsPortableReflection
Assembly: Unity.VisualScripting.Core.dll
Syntax
public static class fsPortableReflection
Fields
EmptyTypes
Declaration
public static Type[] EmptyTypes
Field Value
Methods
AsMemberInfo(Type)
Declaration
public static MemberInfo AsMemberInfo(Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
AsType(MemberInfo)
Declaration
public static Type AsType(MemberInfo member)
Parameters
Returns
GetAttribute(MemberInfo, Type, bool)
Fetches the given attribute from the given MemberInfo. This method
applies caching and is allocation free (after caching has been
performed).
Declaration
public static Attribute GetAttribute(MemberInfo element, Type attributeType, bool shouldCache)
Parameters
Type |
Name |
Description |
MemberInfo |
element |
The MemberInfo the get the attribute from.
|
Type |
attributeType |
The type of attribute to fetch.
|
bool |
shouldCache |
|
Returns
Type |
Description |
Attribute |
The attribute or null.
|
GetAttribute<TAttribute>(MemberInfo)
Declaration
public static TAttribute GetAttribute<TAttribute>(MemberInfo element) where TAttribute : Attribute
Parameters
Returns
Type |
Description |
TAttribute |
|
Type Parameters
Name |
Description |
TAttribute |
|
GetAttribute<TAttribute>(MemberInfo, bool)
Fetches the given attribute from the given MemberInfo.
Declaration
public static TAttribute GetAttribute<TAttribute>(MemberInfo element, bool shouldCache) where TAttribute : Attribute
Parameters
Type |
Name |
Description |
MemberInfo |
element |
The MemberInfo to get the attribute from.
|
bool |
shouldCache |
Should this computation be cached? If this is the only time it will
ever be done, don't bother caching.
|
Returns
Type |
Description |
TAttribute |
The attribute or null.
|
Type Parameters
Name |
Description |
TAttribute |
The type of attribute to fetch.
|
GetDeclaredConstructor(Type, Type[])
Declaration
public static ConstructorInfo GetDeclaredConstructor(this Type type, Type[] parameters)
Parameters
Type |
Name |
Description |
Type |
type |
|
Type[] |
parameters |
|
Returns
GetDeclaredConstructors(Type)
Declaration
public static ConstructorInfo[] GetDeclaredConstructors(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
GetDeclaredFields(Type)
Declaration
public static FieldInfo[] GetDeclaredFields(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
GetDeclaredMember(Type, string)
Declaration
public static MemberInfo GetDeclaredMember(this Type type, string memberName)
Parameters
Returns
GetDeclaredMembers(Type)
Declaration
public static MemberInfo[] GetDeclaredMembers(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
GetDeclaredMethod(Type, string)
Declaration
public static MethodInfo GetDeclaredMethod(this Type type, string methodName)
Parameters
Returns
GetDeclaredMethods(Type)
Declaration
public static MethodInfo[] GetDeclaredMethods(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
GetDeclaredProperties(Type)
Declaration
public static PropertyInfo[] GetDeclaredProperties(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
GetDeclaredProperty(Type, string)
Declaration
public static PropertyInfo GetDeclaredProperty(this Type type, string propertyName)
Parameters
Type |
Name |
Description |
Type |
type |
|
string |
propertyName |
|
Returns
GetFlattenedMember(Type, string)
Declaration
public static MemberInfo[] GetFlattenedMember(this Type type, string memberName)
Parameters
Returns
GetFlattenedMethod(Type, string)
Declaration
public static MethodInfo GetFlattenedMethod(this Type type, string methodName)
Parameters
Returns
GetFlattenedMethods(Type, string)
Declaration
public static IEnumerable<MethodInfo> GetFlattenedMethods(this Type type, string methodName)
Parameters
Returns
GetFlattenedProperty(Type, string)
Declaration
public static PropertyInfo GetFlattenedProperty(this Type type, string propertyName)
Parameters
Type |
Name |
Description |
Type |
type |
|
string |
propertyName |
|
Returns
HasAttribute(MemberInfo, Type)
Returns true if the given attribute is defined on the given element.
Declaration
public static bool HasAttribute(MemberInfo element, Type attributeType)
Parameters
Returns
HasAttribute(MemberInfo, Type, bool)
Returns true if the given attribute is defined on the given element.
Declaration
public static bool HasAttribute(MemberInfo element, Type attributeType, bool shouldCache)
Parameters
Returns
HasAttribute<TAttribute>(MemberInfo)
Returns true if the given attribute is defined on the given element.
Declaration
public static bool HasAttribute<TAttribute>(MemberInfo element)
Parameters
Returns
Type Parameters
Name |
Description |
TAttribute |
|
HasAttribute<TAttribute>(MemberInfo, bool)
Returns true if the given attribute is defined on the given element.
Declaration
public static bool HasAttribute<TAttribute>(MemberInfo element, bool shouldCache)
Parameters
Returns
Type Parameters
Name |
Description |
TAttribute |
|
IsType(MemberInfo)
Declaration
public static bool IsType(MemberInfo member)
Parameters
Returns
Resolve(Type)
Declaration
public static Type Resolve(this Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns