Class ReflectionHelper
Inheritance
Namespace: OpenAPI.Utils
Assembly: OpenAPI.dll
Syntax
public static class ReflectionHelper : object
Methods
| Improve this Doc View SourceGetPrivateFieldValue<T>(Type, Object, String)
Returns a private Property Value from a given Object. Uses Reflection. Throws a ArgumentOutOfRangeException if the Property is not found.
Declaration
public static T GetPrivateFieldValue<T>(Type t, object obj, string propName)
Parameters
Type | Name | Description |
---|---|---|
Type | t | |
System.Object | obj | Object from where the Property Value is returned |
System.String | propName | Propertyname as string. |
Returns
Type | Description |
---|---|
T | PropertyValue |
Type Parameters
Name | Description |
---|---|
T | Type of the Property |
GetPrivatePropertyValue<T>(Type, Object, String)
Returns a private Property Value from a given Object. Uses Reflection. Throws a ArgumentOutOfRangeException if the Property is not found.
Declaration
public static T GetPrivatePropertyValue<T>(Type t, object obj, string propName)
Parameters
Type | Name | Description |
---|---|---|
Type | t | |
System.Object | obj | Object from where the Property Value is returned |
System.String | propName | Propertyname as string. |
Returns
Type | Description |
---|---|
T | PropertyValue |
Type Parameters
Name | Description |
---|---|
T | Type of the Property |
GetPrivateStaticPropertyValue<T>(Type, String)
Declaration
public static T GetPrivateStaticPropertyValue<T>(Type t, string propName)
Parameters
Type | Name | Description |
---|---|---|
Type | t | |
System.String | propName |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
InvokePrivateMethod(Type, Object, String, Object[])
Declaration
public static object InvokePrivateMethod(Type type, object obj, string method, object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
Type | type | |
System.Object | obj | |
System.String | method | |
System.Object[] | parameters |
Returns
Type | Description |
---|---|
System.Object |
SetPrivateFieldValue<T>(Type, Object, String, T)
Set a private Property Value on a given Object. Uses Reflection.
Declaration
public static void SetPrivateFieldValue<T>(Type t, object obj, string propName, T val)
Parameters
Type | Name | Description |
---|---|---|
Type | t | |
System.Object | obj | Object from where the Property Value is returned |
System.String | propName | Propertyname as string. |
T | val | the value to set |
Type Parameters
Name | Description |
---|---|
T | Type of the Property |
SetPrivatePropertyValue<T>(Type, Object, String, T)
Sets a private Property Value from a given Object. Uses Reflection. Throws a ArgumentOutOfRangeException if the Property is not found.
Declaration
public static void SetPrivatePropertyValue<T>(Type t, object obj, string propName, T val)
Parameters
Type | Name | Description |
---|---|---|
Type | t | |
System.Object | obj | Object from where the Property Value is set |
System.String | propName | Propertyname as string. |
T | val | Value to set. |
Type Parameters
Name | Description |
---|---|
T | Type of the Property |