Click or drag to resize

CompositionHost Class

Implementation of ICompositionHost
Inheritance Hierarchy
SystemObject
  TomsToolbox.Desktop.CompositionCompositionHost

Namespace:  TomsToolbox.Desktop.Composition
Assembly:  TomsToolbox.Desktop (in TomsToolbox.Desktop.dll) Version: 1.0.74.0
Syntax
public sealed class CompositionHost : ICompositionHost, 
	IDisposable, IServiceProvider

The CompositionHost type exposes the following members.

Constructors
  NameDescription
Public methodCompositionHost
Initializes a new instance of the CompositionHost class with a container that is thread safe.
Public methodCompositionHost(Boolean)
Initializes a new instance of the CompositionHost class.
Top
Properties
  NameDescription
Public propertyCatalog
Gets the catalog of the container.
Public propertyContainer
Gets the container.
Top
Methods
  NameDescription
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Protected methodFinalize
Finalizes an instance of the CompositionHost class.
(Overrides ObjectFinalize.)
Public methodGetService
Gets the service object of the specified type.

[CanBeNull]

Top
Extension Methods
  NameDescription
Public Extension MethodAddCatalog(ComposablePartCatalog)Overloaded.
Adds a new catalog to the container.
(Defined by CompositionExtensions.)
Public Extension MethodAddCatalog(Assembly)Overloaded.
Adds a new assembly catalog to the containers aggregate catalog.
(Defined by CompositionExtensions.)
Public Extension MethodAddCatalog(Type)Overloaded.
Adds a new type catalog to the containers aggregate catalog.
(Defined by CompositionExtensions.)
Public Extension MethodComposeExportedValueT (Defined by CompositionExtensions.)
Public Extension MethodGetExportedValueTOverloaded.
Returns the exported object with the contract name derived from the specified type parameter. If there is not exactly one matching exported object, an exception is thrown.

[NotNull]

(Defined by CompositionExtensions.)
Public Extension MethodGetExportedValueT(String)Overloaded.
Returns the exported object with the contract name derived from the specified type parameter. If there is not exactly one matching exported object, an exception is thrown.

[NotNull]

(Defined by CompositionExtensions.)
Public Extension MethodGetExportedValueOrDefaultTOverloaded.
Gets the exported object with the contract name derived from the specified type parameter or the default value for the specified type, or throws an exception if there is more than one matching exported object.

[CanBeNull]

(Defined by CompositionExtensions.)
Public Extension MethodGetExportedValueOrDefaultT(String)Overloaded.
Gets the exported object with the contract name derived from the specified type parameter or the default value for the specified type, or throws an exception if there is more than one matching exported object.

[CanBeNull]

(Defined by CompositionExtensions.)
Public Extension MethodGetExportedValuesTOverloaded.
Gets all the exported objects with the contract name derived from the specified type parameter.

[NotNull, ItemNotNull]

(Defined by CompositionExtensions.)
Public Extension MethodGetExportedValuesT(String)Overloaded.
Gets all the exported objects with the specified contract name.

[NotNull, ItemNotNull]

(Defined by CompositionExtensions.)
Public Extension MethodGetExportsTOverloaded.
Gets all the exports.

[NotNull, ItemNotNull]

(Defined by CompositionExtensions.)
Public Extension MethodGetExportsT(String)Overloaded.
Gets all the exports with the specified contract name.

[NotNull, ItemNotNull]

(Defined by CompositionExtensions.)
Public Extension MethodGetServiceT
Gets the service object of the specified type.

[CanBeNull]

(Defined by CompositionExtensions.)
Public Extension MethodCode exampleReportNotDisposedObject
Handle reporting of a not disposed object.

Using this pattern is a good practice to avoid code where disposable objects get never disposed.

Calling this method will raise the NotDisposedObject event if any event handler is attached; otherwise it will throw an InvalidOperationException if a debugger is attached. If the application does not run in a debugger and no event handler is attached, calling this method does nothing.

(Defined by Disposable.)
Public Extension MethodSafeCastT
Performs a cast from object to T, avoiding possible null violations if T is a value type.

[CanBeNull]

(Defined by ObjectExtensions.)
Public Extension MethodSatisfyImportsOnce
Composes the specified part, with recomposition and validation disabled.
(Defined by CompositionExtensions.)
Top
See Also