Show / Hide Table of Contents

Class ModuleManager

Component responsible for coordinating the modules' type loading and module initialization process.

Inheritance
System.Object
ModuleManager
MefModuleManager
Implements
IModuleManager
System.IDisposable
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Sartorius.SAF.Presentation.Modularity
Assembly: Sartorius.SAF.Presentation.dll
Syntax
public class ModuleManager : IModuleManager, IDisposable

Constructors

View Source

ModuleManager(IModuleInitializer, IModuleCatalog)

Initializes an instance of the ModuleManager class.

Declaration
public ModuleManager(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 Source

ModuleCatalog

The module catalog specified in the constructor.

Declaration
protected IModuleCatalog ModuleCatalog { get; }
Property Value
Type Description
IModuleCatalog
View Source

ModuleTypeLoaders

Returns the list of registered IModuleTypeLoader instances that will be used to load the types of modules.

Declaration
public virtual IEnumerable<IModuleTypeLoader> ModuleTypeLoaders { get; set; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<IModuleTypeLoader>

The module type loaders.

Methods

View Source

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()
Remarks

Calls Dispose(Boolean)

View Source

Dispose(Boolean)

Disposes the associated IModuleTypeLoaders.

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

When true, it is being called from the Dispose method.

View Source

HandleModuleTypeLoadingError(ModuleInfo, Exception)

Handles any exception occurred in the module type loading process. This method can be overriden to provide a different behavior.

Declaration
protected virtual void HandleModuleTypeLoadingError(ModuleInfo moduleInfo, Exception exception)
Parameters
Type Name Description
ModuleInfo moduleInfo

The module metadata where the error happened.

System.Exception exception

The exception thrown that is the cause of the current error.

Exceptions
Type Condition
ModuleTypeLoadingException
View Source

LoadModule(String)

Loads and initializes the module on the ModuleCatalog with the name moduleName.

Declaration
public void LoadModule(string moduleName)
Parameters
Type Name Description
System.String moduleName

Name of the module requested for initialization.

View Source

LoadModulesThatAreReadyForLoad()

Loads the modules that are not intialized and have their dependencies loaded.

Declaration
protected void LoadModulesThatAreReadyForLoad()
View Source

ModuleNeedsRetrieval(ModuleInfo)

Checks if the module needs to be retrieved before it's initialized.

Declaration
protected virtual bool ModuleNeedsRetrieval(ModuleInfo moduleInfo)
Parameters
Type Name Description
ModuleInfo moduleInfo

Module that is being checked if needs retrieval.

Returns
Type Description
System.Boolean
View Source

Run()

Initializes the modules marked as WhenAvailable on the ModuleCatalog.

Declaration
public void Run()

Events

View Source

LoadModuleCompleted

Raised when a module is loaded or fails to load.

Declaration
public event EventHandler<LoadModuleCompletedEventArgs> LoadModuleCompleted
Event Type
Type Description
System.EventHandler<LoadModuleCompletedEventArgs>
View Source

ModuleDownloadProgressChanged

Raised repeatedly to provide progress as modules are loaded in the background.

Declaration
public event EventHandler<ModuleDownloadProgressChangedEventArgs> ModuleDownloadProgressChanged
Event Type
Type Description
System.EventHandler<ModuleDownloadProgressChangedEventArgs>

Implements

IModuleManager
System.IDisposable

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)
  • View Source
Back to top Generated by DocFX