Home > Services > DXCore Services – Reflection

DXCore Services – Reflection

September 19th, 2011

The Reflection DXCore service provides access to useful .NET reflection methods.

Here are the methods of this service:

Name

Description

CallInheritedStaticMethod (Type, String, object[]) Calls a static method with the specified arguments inside an ancestor of the specified Type.
CallStaticMethod (MemberInfo) Calls a static method.
CallStaticMethod (MemberInfo, object[]) Calls a static method with the specified arguments.
CallStaticMethod(Type, String) Calls a static method inside the given Type.
CallStaticMethod(Type, String, object[]) Calls a static method inside the given Type with the specified arguments.
CallStaticVirtualMethod (Type, String) Calls a static method inside the given Type (or an ancestor class).
CallStaticVirtualMethod (Type, String, object[]) Calls a static method inside the given Type (or an ancestor class) with the specified arguments.
GetDefaultMembers (Object) Returns an array of default members (which have the DefaultMember attribute set) of the given object.
GetDefaultProperty (Object) Returns the first PropertyInfo instance of the default members (which have the DefaultMember attribute set) of the given object.
GetDefaultPropertyInfo (Object, String, Object) Returns the first PropertyInfo instance of the default members (which have the DefaultMember attribute set) of the value’s object returned by the specified property of the given type.
GetFieldInfo(Object, String) Returns a FieldInfo instance of the specified field from the given object.
GetFieldValue(Object, String) Returns the value of the given field.
GetNonPublicFieldInfo (Object, String) Returns a FieldInfo instance of the specified non-public field from the given object.
GetNonPublicFieldValue (Object, String) Returns the value of the given non-public field.
GetNonPublicPropertyInfo (Object, String) Returns a PropertyInfo instance of the specified non-public property from the given object.
GetNonPublicValue (Object, String) Returns the value of the given non-public property.
GetPropertyDescriptor (Object, String) Returns a PropertyDescriptor instance for the given property inside the specified object.
GetPropertyDescriptor (Object, String, Boolean) Returns a PropertyDescriptor instance for the given property inside the specified object. Optionally specifies whether to ignore case when searching for the specified property name inside the given object.
GetPropertyInfo(Object, String) Returns a PropertyInfo instance of the specified property from the given object.
GetPropertyValueList (Object) Returns a list of properties and values for the given object. This method can be useful to debug objects.
GetValue(Object, String) Returns the value of the given public property in the specified object.
GetValue(Object, String, object[]) Returns the value of the given default indexed property in the specified object.
HasBrowsableProperty (Object, String) Determines whether or not the given object has a specified property that is browsable, as specified in the System.ComponentModel.Browsable attribute.
HasProperty(Object, String, String) Determines whether or not the given object has the specified property.
HasProperty(Object, String, String, Boolean) Determines whether or not the given object has the specified property. Optionally specifies whether to search for a property in descendant types or not.
HasProperty(Object, String, String, Boolean, Boolean) Determines whether or not the given object has the specified property. Optionally specifies whether to search for a property in descendant types and whether a property should be browsable, as specified in the System.ComponentModel.Browsable attribute.
InheritsFrom(Type, String) Returns true if the given type name is inherited from the specified Type.
InheritsFrom(Type, Type) Returns true if the given Type is inherited from the specified Type.
SetFieldValue (Object, String, Object) Sets the value of the specified field in the given object.
SetNonPublicFieldValue (Object, String, Object) Sets the value of the non-public field supported by the given object.
SetNonPublicValue (Object, String, Object) Sets the value of the non-public property supported by the given object.
SetProperty(Object, String, Object) Sets the value for the specified public property. Use this method to change the component properties at design-time. The document will be automatically marked as being modified, and undo will be automatically supported.
SetValue(Object, String, Object) Sets the value for the specified property in the given object.
SetValue(Object, String, Object, object[]) Sets the value for the specified default indexed property in the given object.
StringToEnum(Type, String) Converts the string representation of the given name or numeric value of one or more enumerated constants to an equivalent enumerated object.
StringToEnum(Type, String, Boolean) Converts the string representation of the given name or numeric value of one or more enumerated constants to an equivalent enumerated object. A boolean parameter specifies whether the operation is case-sensitive.
TypesMatch(Type, String, Boolean) Determines whether the specified types are equivalent. Optionally specifies whether descendant types qualify as equivalent.
 
—–
Products: DXCore
Versions: 11.1 and up
VS IDEs: any
Updated: Sep/19/2011
ID: D116

Similar Posts: