Class MefModuleManager
Component responsible for coordinating the modules' type loading and module initialization process.
Implements
Namespace: Sartorius.SAF.Presentation.MefExtensions
Assembly: Sartorius.SAF.Presentation.dll
Syntax
[Export(typeof(IModuleManager))]
public class MefModuleManager : ModuleManager, IModuleManager, IDisposable, IPartImportsSatisfiedNotification
Remarks
This allows the MefBootstrapper to provide this class as a default implementation. If another implementation is found, this export will not be used.
Constructors
View SourceMefModuleManager(IModuleInitializer, IModuleCatalog)
Initializes a new instance of the MefModuleManager class.
Declaration
[ImportingConstructor]
public MefModuleManager(IModuleInitializer moduleInitializer, IModuleCatalog moduleCatalog)
Parameters
Type | Name | Description |
---|---|---|
IModuleInitializer | moduleInitializer | Service used for initialization of modules. |
IModuleCatalog | moduleCatalog | Catalog that enumerates the modules to be loaded and initialized. |
Properties
View SourceImportedModules
Gets or sets the modules to be imported.
Declaration
[ImportMany(AllowRecomposition = true)]
protected IEnumerable<Lazy<IModule, IModuleExport>> ImportedModules { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Lazy<IModule, IModuleExport>> |
Remarks
Import the available modules from the MEF container
Methods
View SourceModuleNeedsRetrieval(ModuleInfo)
Checks if the module needs to be retrieved before it's initialized.
Declaration
protected override bool ModuleNeedsRetrieval(ModuleInfo moduleInfo)
Parameters
Type | Name | Description |
---|---|---|
ModuleInfo | moduleInfo | Module that is being checked if needs retrieval. |
Returns
Type | Description |
---|---|
System.Boolean | True if the module needs to be retrieved. Otherwise, false. |
Overrides
View SourceOnImportsSatisfied()
Called when a part's imports have been satisfied and it is safe to use.
Declaration
public virtual void OnImportsSatisfied()
Remarks
Whenever the MEF container loads new types that cause ImportedModules to be recomposed, this is called. This method ensures that as the MEF container discovered new modules, the ModuleCatalog is updated.