A utility class for performing reflection operations. It provides methods to reflect the value of a field, property, or method from an object or a serialized property. It also caches the fields, properties, and methods to avoid repeated reflection.
Static Member Functions
static bool ReflectFieldValue< T >
( object obj,
string fieldName,
out T data )
Reflects the value of a field from an object.
Parameters
obj
The object to reflect the field value from.
fieldName
The name of the field.
data
The output parameter to store the reflected field value.
Returns
True if the field exists, false otherwise.
static bool ReflectPropertyValue< T >
( object obj,
string fieldName,
out T data )
Reflects the value of a property from an object.
Parameters
obj
The object to reflect the property value from.
fieldName
The name of the property.
data
The output parameter to store the reflected property value.
Returns
True if the property exists, false otherwise.
static bool ReflectMethodValue< T >
( object obj,
string fieldName,
out T data )
Reflects the value of a method from an object.
Parameters
obj
The object to reflect the method value from.
fieldName
The name of the method.
data
The output parameter to store the reflected method value.
Returns
True if the method exists, false otherwise.
static bool TryReflectValue< T >
( object obj,
string fieldName,
out T value )
Get the value of a field, property, or method that is passed in by name from an object.
Priority Search Order:
Field
Property
Method
Parameters
obj
The object to reflect the value from.
fieldName
The name of the field, property, or method.
value
The resulting reflected value
static T ReflectValue< T >
( object obj,
string fieldName )
Get the value of a field, property, or method that is passed in by name from an object.
Priority Search Order:
Field
Property
Method
Parameters
obj
The object to reflect the value from.
fieldName
The name of the field, property, or method.
value
The reflected value of the field/property/method called fieldName
Exceptions
ArgumentException
Thrown when no field, property, or method is found with the given name.
Object Data for package-static-func
static Type [] GetAllAssignableTypes< T > ( )
Retrieves all instantiatable types which are assignable from the given type T
Parameters
instance
the type on which this is called
Returns
a collection of types
static Type [] GetTypesWithAttribute< T > ( )
Retrieves all classes which are tagged with the specified T attribute
static MethodInfo [] GetMethodsWithAttribute< T > ( )
Retrieves all methods which are tagged with the specified T attribute