Show / Hide Table of Contents

Class MefBootstrapper

Base class that provides a basic bootstrapping sequence that registers most of the Composite Application Library assets in a MEF System.ComponentModel.Composition.Hosting.CompositionContainer.

Inheritance
System.Object
MefBootstrapper
ApplicationBootstrapper
TestBootstrapper
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.MefExtensions
Assembly: Sartorius.SAF.Presentation.dll
Syntax
public abstract class MefBootstrapper
Remarks

This class must be overriden to provide application specific configuration.

Constructors

View Source

MefBootstrapper(IConfigurationRoot)

Initializes the BootstrapperBase class.

Declaration
protected MefBootstrapper(IConfigurationRoot configurationRoot)
Parameters
Type Name Description
Microsoft.Extensions.Configuration.IConfigurationRoot configurationRoot

Properties

View Source

AggregateCatalog

Gets or sets the default AggregateCatalog for the application.

Declaration
protected AggregateCatalog AggregateCatalog { get; set; }
Property Value
Type Description
System.ComponentModel.Composition.Hosting.AggregateCatalog

The default AggregateCatalog instance.

View Source

CompositionCompleted

Raised when the composition of the container has been completed.

Declaration
public Action<CompositionContainer> CompositionCompleted { get; set; }
Property Value
Type Description
System.Action<System.ComponentModel.Composition.Hosting.CompositionContainer>
View Source

Container

Gets or sets the default System.ComponentModel.Composition.Hosting.CompositionContainer for the application.

Declaration
protected CompositionContainer Container { get; set; }
Property Value
Type Description
System.ComponentModel.Composition.Hosting.CompositionContainer

The default System.ComponentModel.Composition.Hosting.CompositionContainer instance.

View Source

ModuleCatalog

Gets the default IModuleCatalog for the application.

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

The default IModuleCatalog instance.

View Source

ServiceFactory

Gets or sets the IServiceFactory.

Declaration
public IServiceFactory ServiceFactory { get; set; }
Property Value
Type Description
IServiceFactory

Methods

View Source

ConfigureAggregateCatalog()

Configures the AggregateCatalog used by MEF.

Declaration
protected virtual void ConfigureAggregateCatalog()
Remarks

The base implementation does nothing.

View Source

ConfigureContainer()

Configures the System.ComponentModel.Composition.Hosting.CompositionContainer. May be overwritten in a derived class to add specific type mappings required by the application.

Declaration
protected virtual void ConfigureContainer()
Remarks

The base implementation registers all the types direct instantiated by the bootstrapper with the container. If the method is overwritten, the new implementation should call the base class version.

View Source

ConfigureDefaultRegionBehaviors()

Configures the IRegionBehaviorFactory. This will be the list of default behaviors that will be added to a region.

Declaration
protected virtual IRegionBehaviorFactory ConfigureDefaultRegionBehaviors()
Returns
Type Description
IRegionBehaviorFactory
View Source

ConfigureModuleCatalog()

Configures the IModuleCatalog used by Prism.

Declaration
protected virtual void ConfigureModuleCatalog()
View Source

ConfigureRegionAdapterMappings()

Configures the default region adapter mappings to use in the application, in order to adapt UI controls defined in XAML to use a region and register it automatically. May be overwritten in a derived class to add specific mappings required by the application.

Declaration
protected virtual RegionAdapterMappings ConfigureRegionAdapterMappings()
Returns
Type Description
RegionAdapterMappings

The RegionAdapterMappings instance containing all the mappings.

View Source

ConfigureServiceLocator()

Configures the LocatorProvider for the CommonServiceLocator.ServiceLocator.

Declaration
protected virtual void ConfigureServiceLocator()
Remarks

The base implementation also sets the ServiceLocator provider singleton.

View Source

CreateAggregateCatalog()

Configures the AggregateCatalog used by MEF.

Declaration
protected virtual AggregateCatalog CreateAggregateCatalog()
Returns
Type Description
System.ComponentModel.Composition.Hosting.AggregateCatalog

An AggregateCatalog to be used by the bootstrapper.

Remarks

The base implementation returns a new AggregateCatalog.

View Source

CreateContainer()

Creates the System.ComponentModel.Composition.Hosting.CompositionContainer that will be used as the default container.

Declaration
protected virtual CompositionContainer CreateContainer()
Returns
Type Description
System.ComponentModel.Composition.Hosting.CompositionContainer

A new instance of System.ComponentModel.Composition.Hosting.CompositionContainer.

Remarks

The base implementation registers a default MEF catalog of exports of key Prism types. Exporting your own types will replace these defaults.

View Source

CreateModuleCatalog()

Creates the IModuleCatalog used by Prism.

Declaration
protected virtual IModuleCatalog CreateModuleCatalog()
Returns
Type Description
IModuleCatalog
Remarks

The base implementation returns a new ModuleCatalog.

View Source

CreateServiceFactory()

Creates the IServiceFactory.

Declaration
protected virtual IServiceFactory CreateServiceFactory()
Returns
Type Description
IServiceFactory
View Source

InitializeApplication()

Initialize and start the application.

Declaration
protected virtual void InitializeApplication()
View Source

InitializeModules()

Initializes the modules. May be overwritten in a derived class to use a custom Modules Catalog

Declaration
protected virtual void InitializeModules()
View Source

RegisterBootstrapperProvidedTypes()

Helper method for configuring the System.ComponentModel.Composition.Hosting.CompositionContainer. Registers all the types direct instantiated by the bootstrapper with the container.

Declaration
protected virtual void RegisterBootstrapperProvidedTypes()
View Source

RegisterDefaultTypesIfMissing()

Helper method for configuring the System.ComponentModel.Composition.Hosting.CompositionContainer. Registers defaults for all the types necessary for Prism to work, if they are not already registered.

Declaration
public virtual void RegisterDefaultTypesIfMissing()
View Source

RegisterFrameworkExceptionTypes()

Registers the System.Types of the Exceptions that are not considered root exceptions by the ExceptionExtensions.

Declaration
protected virtual void RegisterFrameworkExceptionTypes()
View Source

Run()

Runs the bootstrapper process.

Declaration
public void Run()
View Source

Run(Boolean)

Run the bootstrapper process.

Declaration
public virtual void Run(bool runWithDefaultConfiguration)
Parameters
Type Name Description
System.Boolean runWithDefaultConfiguration

If true, registers default Composite Application Library services in the container. This is the default behavior.

Extension Methods

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