Interface IReflectionHelper
Namespace: LemonEdge.Utils
Assembly: LemonEdge.Utils.dll
Syntax
public interface IReflectionHelper
Properties
CustomAssemblies
All custom assemblies dynamically loaded by LemonEdge through AddIn Modules
Declaration
Assembly[] CustomAssemblies { get; }
Property Value
| Type | Description |
|---|---|
| Assembly[] |
InvalidCustomAssemblies
List of custom assemblies that have not been correctly loaded
Declaration
IEnumerable<(Assembly Assem, StringBuilder Reason)> InvalidCustomAssemblies { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<(Assembly Assem, StringBuilder Reason)> |
StandardAssemblies
All standard assemblies as part of the LemonEdge application
Declaration
Assembly[] StandardAssemblies { get; }
Property Value
| Type | Description |
|---|---|
| Assembly[] |
Methods
AddAssembly(Assembly, Assembly)
Indicates the system has loaded a specified assembly into the LemonEdge app domain and it should be added to the
reflection cache, and can optionally replace any older version
Declaration
void AddAssembly(Assembly assembly, Assembly replace = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Assembly | assembly | Add this assembly to the reflection cache |
| Assembly | replace | Replace this existing assembly in the reflection cache with the specified
|
Remarks
This is used by the core LemonEdge system when loading custom addins. As users can change addins this allows the system to replace older versions with newer ones as they are updated.
GetAllDomainAssemblies()
Return all dlls loaded into the current domain. Excludes any dlls that have subsequently been unloaded.
Declaration
IEnumerable<Assembly> GetAllDomainAssemblies()
Returns
| Type | Description |
|---|---|
| IEnumerable<Assembly> | A list of currently loaded assemblies, including custom LemonEdge AddIns that have been loaded |
GetAppInfo()
Returns the location and application name of the currently executing application
Declaration
(string Path, string AppName) GetAppInfo()
Returns
| Type | Description |
|---|---|
| (string paramArguments, string queryFilter) | The location and application name of the currently executing application |
GetEnumTypes()
Returns a list of all Enum types in the system
Declaration
IEnumerable<Type> GetEnumTypes()
Returns
| Type | Description |
|---|---|
| IEnumerable<Type> | A list of all Enums in the system |
GetNestedPropertyInfo(Type, string, string, bool)
Returns the PropertyInfo definition for the specified property against a property on this type. Given Entity.ParentProperty.NestedProperty, this returns NestedProperty's definition.
Declaration
PropertyInfo GetNestedPropertyInfo(Type type, string parentPropertyName, string nestedPropertyName = null, bool throwIfMissing = true)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The type that holds the specified property |
| string | parentPropertyName | The parent property that contains nestedPropertyName |
| string | nestedPropertyName | The property to return property info on |
| bool | throwIfMissing | Indicates if the property isn't found an ArgumentOutOfRangeException should be thrown, otherwise null is returned |
Returns
| Type | Description |
|---|---|
| PropertyInfo | The PropertyInfo for the specified |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | If |
GetPropertyInfo(Type, string, bool)
Returns the PropertyInfo definition for the specified property against this type
Declaration
PropertyInfo GetPropertyInfo(Type type, string propName, bool throwIfMissing = true)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The type that holds the specified property |
| string | propName | The property to return property info on |
| bool | throwIfMissing | Indicates if the property isn't found an ArgumentOutOfRangeException should be thrown, otherwise null is returned |
Returns
| Type | Description |
|---|---|
| PropertyInfo | The PropertyInfo for the specified |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | If |
GetTypeFromFullName(string)
Returns an instance of the type specified from the full name
Declaration
Type GetTypeFromFullName(string fullName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fullName | The full name of a given type |
Returns
| Type | Description |
|---|---|
| Type | An instance of the type specified by its |
GetTypesInheritingFrom(Assembly, Type, bool)
Returns all types from the specified assembly that inherit the specified type
Declaration
IEnumerable<Type> GetTypesInheritingFrom(Assembly assembly, Type type, bool allowAbstract)
Parameters
| Type | Name | Description |
|---|---|---|
| Assembly | assembly | The assembly to return matching types from |
| Type | type | The type to retrieve all other types that inherits from it |
| bool | allowAbstract | Indicates if abstract types are to be included in the result set or not |
Returns
| Type | Description |
|---|---|
| IEnumerable<Type> | A list of all types from the |
GetTypesInheritingFrom(Type, bool)
Returns all types that inherit from the specified type
Declaration
IEnumerable<Type> GetTypesInheritingFrom(Type type, bool allowAbstract)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The type to retrieve all other types that inherits from it |
| bool | allowAbstract | Indicates if abstract types are to be included in the result set or not |
Returns
| Type | Description |
|---|---|
| IEnumerable<Type> | A list of all types that inherit from |
GetTypesInheritingFrom<T>(bool)
Returns all types that inherit from the specified type T
Declaration
IEnumerable<Type> GetTypesInheritingFrom<T>(bool allowAbstract)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | allowAbstract | Indicates if abstract types are to be included in the result set or not |
Returns
| Type | Description |
|---|---|
| IEnumerable<Type> | A list of all types that inherit from |
Type Parameters
| Name | Description |
|---|---|
| T | The type to retrieve all other types that inherits from it |
GetTypesWithAttribute<T>(bool)
Returns a list of all types in the system that are marked with the specified attribute
Declaration
IEnumerable<(T AttributeInstance, Type Type)> GetTypesWithAttribute<T>(bool inherit = false) where T : Attribute
Parameters
| Type | Name | Description |
|---|---|---|
| bool | inherit | Indicates that a type should be included if the attribute is marked against its base type and not just itself |
Returns
| Type | Description |
|---|---|
| IEnumerable<(T AttributeInstance, Type Type)> | A tuple list containing the attribute |
Type Parameters
| Name | Description |
|---|---|
| T | The attribute type to find all types that are marked with it |