Class ReflectionUtils
- Namespace
- JJMasterData.Commons.Util
- Assembly
- JJMasterData.Commons.dll
public static class ReflectionUtils
- Inheritance
-
ReflectionUtils
- Inherited Members
Methods
GetDefinedTypes<T>(IEnumerable<Assembly>)
public static IEnumerable<TypeInfo> GetDefinedTypes<T>(IEnumerable<Assembly> assemblies)
Parameters
assemblies
IEnumerable<Assembly>
Returns
Type Parameters
T
GetStaticProperty(string, string)
Retrieves a value from a static property by specifying a type full name and property
public static object GetStaticProperty(string typeName, string property)
Parameters
Returns
GetStaticProperty(Type, string)
Returns a static property from a given type
public static object GetStaticProperty(Type type, string property)
Parameters
Returns
GetTypeFromName(string, string)
Helper routine that looks up a type name and tries to retrieve the full type reference using GetType() and if not found looking in the actively executing assemblies and optionally loading the specified assembly name.
public static Type GetTypeFromName(string typeName, string assemblyName = null)
Parameters
typeName
stringtype to load
assemblyName
stringOptional assembly name to load from if type cannot be loaded initially. Use for lazy loading of assemblies without taking a type dependency.
Returns
- Type
null
GetTypeFromProperty<T>(IEnumerable<Assembly>)
public static IEnumerable<TypeInfo> GetTypeFromProperty<T>(IEnumerable<Assembly> assemblies)
Parameters
assemblies
IEnumerable<Assembly>
Returns
Type Parameters
T
IsMethodImplemented(Type, string)
public static bool IsMethodImplemented(Type type, string methodName)
Parameters
Returns
LoadAssembly(string)
Try to load an assembly into the application's app domain. Loads by name first then checks for filename
public static Assembly LoadAssembly(string assemblyName)
Parameters
assemblyName
stringAssembly name or full path
Returns
- Assembly
null on failure