AssemblyRegistry Class
Namespace: Stride.Core.ReflectionAssembly: Stride.Core.dll
Provides a basic infrastructure to associate an assembly with some categories and to query and register on new registered assembly event.
public static class AssemblyRegistry
| Name | Description | |
|---|---|---|
| Methods | ||
| Find(IEnumerable<String>) | Finds registered assemblies that are associated with the specified categories. |
|
| Find(String[]) | Finds registered assemblies that are associated with the specified categories. |
|
| FindAll() | Finds all registered assemblies. |
|
| FindCategories(Assembly) | Finds registered categories that are associated with the specified assembly. |
|
| GetScanTypes(Assembly) | ||
| GetType(String, Boolean) | Gets a type by its typename already loaded in the assembly registry. |
|
| GetTypeFromAlias(String) | ||
| Register(Assembly, IEnumerable<String>) | Registers an assembly with the specified categories. |
|
| Register(Assembly, String[]) | Registers an assembly with the specified categories. |
|
| RegisterScanTypes(Assembly, AssemblyRegistry.ScanTypes) | ||
| Unregister(Assembly) | Unregisters the specified assembly. |
|
| Events | ||
| AssemblyRegistered | Occurs when an assembly is registered. |
|
| AssemblyUnregistered | Occurs when an assembly is registered. |
|
Methods
Find(IEnumerable<String>)
Finds registered assemblies that are associated with the specified categories.
public static HashSet<Assembly> Find(IEnumerable<string> categories)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.String> | categories | The categories. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.HashSet<System.Reflection.Assembly> | A set of assembly associated with the specified categories. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | categories |
Find(String[])
Finds registered assemblies that are associated with the specified categories.
public static HashSet<Assembly> Find(params string[] categories)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String[] | categories | The categories. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.HashSet<System.Reflection.Assembly> | A set of assemblies associated with the specified categories. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | categories |
FindAll()
Finds all registered assemblies.
public static HashSet<Assembly> FindAll()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.HashSet<System.Reflection.Assembly> | A set of all assembly registered. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | categories |
FindCategories(Assembly)
Finds registered categories that are associated with the specified assembly.
public static HashSet<string> FindCategories(Assembly assembly)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.Assembly | assembly | The assembly. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.HashSet<System.String> | A set of category associated with the specified assembly. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | categories |
GetScanTypes(Assembly)
public static AssemblyRegistry.ScanTypes GetScanTypes(Assembly assembly)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.Assembly | assembly |
Returns
| Type | Description |
|---|---|
| AssemblyRegistry.ScanTypes |
GetType(String, Boolean)
Gets a type by its typename already loaded in the assembly registry.
public static Type GetType(string fullyQualifiedTypeName, bool throwOnError = true)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | fullyQualifiedTypeName | The typename |
| System.Boolean | throwOnError |
Returns
| Type | Description |
|---|---|
| System.Type | The type instance or null if not found. |
See Also
GetTypeFromAlias(String)
public static Type GetTypeFromAlias(string alias)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | alias |
Returns
| Type | Description |
|---|---|
| System.Type |
Register(Assembly, IEnumerable<String>)
Registers an assembly with the specified categories.
public static void Register(Assembly assembly, IEnumerable<string> categories)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.Assembly | assembly | The assembly. |
| System.Collections.Generic.IEnumerable<System.String> | categories | The categories to associate with this assembly. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | assembly or categories |
Register(Assembly, String[])
Registers an assembly with the specified categories.
public static void Register(Assembly assembly, params string[] categories)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.Assembly | assembly | The assembly. |
| System.String[] | categories | The categories to associate with this assembly. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | assembly or categories |
RegisterScanTypes(Assembly, AssemblyRegistry.ScanTypes)
public static void RegisterScanTypes(Assembly assembly, AssemblyRegistry.ScanTypes types)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.Assembly | assembly | |
| AssemblyRegistry.ScanTypes | types |
Unregister(Assembly)
Unregisters the specified assembly.
public static void Unregister(Assembly assembly)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.Assembly | assembly | The assembly. |
Events
AssemblyRegistered
Occurs when an assembly is registered.
public static event EventHandler<AssemblyRegisteredEventArgs> AssemblyRegistered
Event Type
| Type | Description |
|---|---|
| System.EventHandler<AssemblyRegisteredEventArgs> |
AssemblyUnregistered
Occurs when an assembly is registered.
public static event EventHandler<AssemblyRegisteredEventArgs> AssemblyUnregistered
Event Type
| Type | Description |
|---|---|
| System.EventHandler<AssemblyRegisteredEventArgs> |