Class ModuleInitializer
Implements the IModuleInitializer interface. Handles loading of a module based on a type.
Implements
Namespace: Sartorius.SAF.Presentation.Modularity
Assembly: Sartorius.SAF.Presentation.dll
Syntax
public class ModuleInitializer : IModuleInitializer
  Constructors
View SourceModuleInitializer(IServiceLocator)
Initializes a new instance of ModuleInitializer.
Declaration
public ModuleInitializer(IServiceLocator serviceLocator)
  Parameters
| Type | Name | Description | 
|---|---|---|
| CommonServiceLocator.IServiceLocator | serviceLocator | The container that will be used to resolve the modules by specifying its type.  | 
      
Methods
View SourceCreateModule(ModuleInfo)
Uses the container to resolve a new IModule by specifying its System.Type.
Declaration
protected virtual IModule CreateModule(ModuleInfo moduleInfo)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ModuleInfo | moduleInfo | The module to create.  | 
      
Returns
| Type | Description | 
|---|---|
| IModule | A new instance of the module specified by   | 
      
CreateModule(String)
Uses the container to resolve a new IModule by specifying its System.Type.
Declaration
protected virtual IModule CreateModule(string typeName)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | typeName | The type name to resolve. This type must implement IModule.  | 
      
Returns
| Type | Description | 
|---|---|
| IModule | A new instance of   | 
      
HandleModuleInitializationError(ModuleInfo, String, Exception)
Handles any exception occured in the module Initialization process. This method can be overriden to provide a different behavior.
Declaration
public virtual void HandleModuleInitializationError(ModuleInfo moduleInfo, string assemblyName, Exception exception)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ModuleInfo | moduleInfo | The module metadata where the error happened.  | 
      
| System.String | assemblyName | The assembly name.  | 
      
| System.Exception | exception | The exception thrown that is the cause of the current error.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| ModuleInitializeException | 
Initialize(ModuleInfo)
Initializes the specified module.
Declaration
public void Initialize(ModuleInfo moduleInfo)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ModuleInfo | moduleInfo | The module to initialize  |