Click or drag to resize

ReflectionUtils Methods

The ReflectionUtils type exposes the following members.

Methods
  NameDescription
Public methodStatic memberCallMethod(Object, String, Object)
Calls a method on an object dynamically. This version doesn't require specific parameter signatures to be passed. Instead parameter types are inferred based on types passed. Note that if you pass a null parameter, type inferrance cannot occur and if overloads exist the call may fail. if so use the more detailed overload of this method.
Public methodStatic memberCallMethod(Object, String, Type, Object)
Calls a method on an object dynamically. This version requires explicit specification of the parameter type signatures.
Public methodStatic memberCallMethodCom
Wrapper method to call a 'dynamic' (non-typelib) method on a COM object
Public methodStatic memberCallMethodEx
Calls a method on an object with extended . syntax (object: this Method: Entity.CalculateOrderTotal)
Public methodStatic memberCallMethodExCom
Calls a method on a COM object with '.' syntax (Customer instance and Address.DoSomeThing method)
Public methodStatic memberCreateComInstance
Creates a COM instance from a ProgID. Loads either Exe or DLL servers.
Public methodStatic memberCreateInstanceFromString
Creates an instance of a type based on a string. Assumes that the type's
Public methodStatic memberCreateInstanceFromType
Creates an instance from a type by calling the parameterless constructor. Note this will not work with COM objects - continue to use the Activator.CreateInstance for COM objects.
Public methodStatic memberGetEnumList
Returns a List of KeyValuePair object
Public methodStatic memberGetField
Retrieve a field dynamically from an object. This is a simple implementation that's straight Reflection and doesn't support indexers.
Public methodStatic memberGetProperty
Retrieve a property value from an object dynamically. This is a simple version that uses Reflection calls directly. It doesn't support indexers.
Public methodStatic memberGetPropertyCom
Retrieve a dynamic 'non-typelib' property
Public methodStatic memberGetPropertyEx
Returns a property or field value using a base object and sub members including . syntax. For example, you can access: oCustomer.oData.Company with (this,"oCustomer.oData.Company") This method also supports indexers in the Property value such as: Customer.DataSet.Tables["Customers"].Rows[0]
Public methodStatic memberGetPropertyExCom
Returns a property or field value using a base object and sub members including . syntax. For example, you can access: oCustomer.oData.Company with (this,"oCustomer.oData.Company")
Public methodStatic memberGetPropertyInfoEx
Returns a PropertyInfo object for a given dynamically accessed property Property selection can be specified using . syntax ("Address.Street" or "DataTable[0].Rows[1]") hence the Ex name for this function.
Public methodStatic memberGetPropertyInfoInternal
Returns a PropertyInfo structure from an extended Property reference
Public methodStatic memberGetStaticProperty(String, String)
Retrieves a value from a static property by specifying a type full name and property
Public methodStatic memberGetStaticProperty(Type, String)
Returns a static property from a given type
Public methodStatic memberGetTypeFromName
Helper routine that looks up a type name and tries to retrieve the full type reference in the actively executing assemblies.
Public methodStatic memberSetField
Sets the field on an object. This is a simple method that uses straight Reflection and doesn't support indexers.
Public methodStatic memberSetProperty
Sets the property on an object. This is a simple method that uses straight Reflection and doesn't support indexers.
Public methodStatic memberSetPropertyCom
Sets the property on an object.
Public methodStatic memberSetPropertyEx
Sets a value on an object. Supports . syntax for named properties (ie. Customer.Entity.Company) as well as indexers.
Public methodStatic memberSetPropertyExCom
Sets the value of a field or property via Reflection. This method alws for using '.' syntax to specify objects multiple levels down. ReflectionUtils.SetPropertyEx(this,"Invoice.LineItemsCount",10) which would be equivalent of: Invoice.LineItemsCount = 10;
Public methodStatic memberStringToTypedValue(String, Type)
Turns a string into a typed value generically. Explicitly assigns common types and falls back on using type converters for unhandled types. Common uses: * UI -> to data conversions * Parsers
Public methodStatic memberStringToTypedValue(String, Type, CultureInfo)
Turns a string into a typed value generically. Explicitly assigns common types and falls back on using type converters for unhandled types. Common uses: * UI -> to data conversions * Parsers
Public methodStatic memberStringToTypedValueT(String)
Generic version allow for automatic type conversion without the explicit type parameter. Defaults conversion to CurrentCulture.
Public methodStatic memberStringToTypedValueT(String, CultureInfo)
Generic version allow for automatic type conversion without the explicit type parameter
Public methodStatic memberTypedValueToString(Object)
Converts a type to string if possible. This method uses the current culture for numeric and DateTime values. It calls the ToString() method on common types and uses a type converter on all other objects if available.
Public methodStatic memberTypedValueToString(Object, CultureInfo)
Converts a type to string if possible. This method supports an optional culture generically on any value. It calls the ToString() method on common types and uses a type converter on all other objects if available
Top
See Also