Class TypeExtensions
Extension methods for the Type class.
Namespace: Evergine.Common.Helpers
Assembly: Evergine.Common.dll
Syntax
public static class TypeExtensions
Methods
GetAllInstances<T>(Assembly, (Type type, object instance)[], params string[])
Finds and instantiates the specified types in the given assembly, using the parameters for a call to the constructor.
Declaration
public static IEnumerable<T> GetAllInstances<T>(this Assembly assembly, (Type type, object instance)[] constructorParameters, params string[] typeNames)
Parameters
| Type | Name | Description |
|---|---|---|
| Assembly | assembly | The assembly in which to find the types. |
| (Type type, object instance)[] | constructorParameters | The parameters used to find a matching constructor. |
| string[] | typeNames | The type names. |
Returns
| Type | Description |
|---|---|
| IEnumerable<T> | The enumerable of instances. |
Type Parameters
| Name | Description |
|---|---|
| T | The base type. |
GetSimpleAssemblyQualifiedName(Type)
Gets the assembly qualified name, but without the version and public token.
Declaration
public static string GetSimpleAssemblyQualifiedName(this Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | Type to get the name for. |
Returns
| Type | Description |
|---|---|
| string | Simple assembly qualified name. Example:
|