Class CompositionContextExtensions
Extension methods for ICompositionContext.
Inheritance
Inherited Members
Namespace: Kephas.Composition
Assembly: Kephas.Core.dll
Syntax
public static class CompositionContextExtensions
Methods
| Improve this Doc View SourceGetExportFactories(ICompositionContext, Type)
Resolves the specified contract type as an enumeration of export factories.
Declaration
public static IEnumerable GetExportFactories(this ICompositionContext compositionContext, Type contractType)
Parameters
Type | Name | Description |
---|---|---|
ICompositionContext | compositionContext | The compositionContext to act on. |
System.Type | contractType | Type of the contract. |
Returns
Type | Description |
---|---|
System.Collections.IEnumerable | An enumeration of export factories of an object implementing |
GetExportFactories(ICompositionContext, Type, Type)
Resolves the specified contract type as an enumeration of export factories with metadata.
Declaration
public static IEnumerable GetExportFactories(this ICompositionContext compositionContext, Type contractType, Type metadataType)
Parameters
Type | Name | Description |
---|---|---|
ICompositionContext | compositionContext | The compositionContext to act on. |
System.Type | contractType | Type of the contract. |
System.Type | metadataType | Type of the metadata. |
Returns
Type | Description |
---|---|
System.Collections.IEnumerable | An enumeration of export factories of an object implementing |
GetExportFactories<T>(ICompositionContext)
Resolves the specified contract type as an enumeration of export factories.
Declaration
public static IEnumerable<IExportFactory<T>> GetExportFactories<T>(this ICompositionContext compositionContext)
Parameters
Type | Name | Description |
---|---|---|
ICompositionContext | compositionContext | The compositionContext to act on. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IExportFactory<T>> | An object implementing |
Type Parameters
Name | Description |
---|---|
T | The contract type. |
GetExportFactories<T, TMetadata>(ICompositionContext)
Resolves the specified contract type as an enumeration of export factories with metadata.
Declaration
public static IEnumerable<IExportFactory<T, TMetadata>> GetExportFactories<T, TMetadata>(this ICompositionContext compositionContext)
Parameters
Type | Name | Description |
---|---|---|
ICompositionContext | compositionContext | The compositionContext to act on. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IExportFactory<T, TMetadata>> | An object implementing |
Type Parameters
Name | Description |
---|---|
T | The contract type. |
TMetadata | The metadata type. |
GetExportFactory(ICompositionContext, Type)
Resolves the specified contract type as an export factory.
Declaration
public static object GetExportFactory(this ICompositionContext compositionContext, Type contractType)
Parameters
Type | Name | Description |
---|---|---|
ICompositionContext | compositionContext | The compositionContext to act on. |
System.Type | contractType | Type of the contract. |
Returns
Type | Description |
---|---|
System.Object | A export factory of an object implementing |
GetExportFactory(ICompositionContext, Type, Type)
Resolves the specified contract type as an export factory with metadata.
Declaration
public static object GetExportFactory(this ICompositionContext compositionContext, Type contractType, Type metadataType)
Parameters
Type | Name | Description |
---|---|---|
ICompositionContext | compositionContext | The compositionContext to act on. |
System.Type | contractType | Type of the contract. |
System.Type | metadataType | Type of the metadata. |
Returns
Type | Description |
---|---|
System.Object | A export factory of an object implementing |
GetExportFactory<T>(ICompositionContext)
Resolves the specified contract type as an export factory.
Declaration
public static IExportFactory<T> GetExportFactory<T>(this ICompositionContext compositionContext)
Parameters
Type | Name | Description |
---|---|---|
ICompositionContext | compositionContext | The compositionContext to act on. |
Returns
Type | Description |
---|---|
IExportFactory<T> | An object implementing |
Type Parameters
Name | Description |
---|---|
T | The contract type. |
GetExportFactory<T, TMetadata>(ICompositionContext)
Resolves the specified contract type as an export factory with metadata.
Declaration
public static IExportFactory<T, TMetadata> GetExportFactory<T, TMetadata>(this ICompositionContext compositionContext)
Parameters
Type | Name | Description |
---|---|---|
ICompositionContext | compositionContext | The compositionContext to act on. |
Returns
Type | Description |
---|---|
IExportFactory<T, TMetadata> | An object implementing |
Type Parameters
Name | Description |
---|---|
T | The contract type. |
TMetadata | The metadata type. |
GetLogger(ICompositionContext, String)
Gets the logger with the provided name.
Declaration
[Pure]
public static ILogger GetLogger(this ICompositionContext compositionContext, string loggerName)
Parameters
Type | Name | Description |
---|---|---|
ICompositionContext | compositionContext | The composition context to act on. |
System.String | loggerName | Name of the logger. |
Returns
Type | Description |
---|---|
ILogger | A logger for the provided name. |
GetLogger(ICompositionContext, Type)
Gets the logger for the provided type.
Declaration
[Pure]
public static ILogger GetLogger(this ICompositionContext compositionContext, Type type)
Parameters
Type | Name | Description |
---|---|---|
ICompositionContext | compositionContext | The composition context to act on. |
System.Type | type | The type. |
Returns
Type | Description |
---|---|
ILogger | A logger for the provided type. |
GetLogger<T>(ICompositionContext)
Gets the logger for the provided type.
Declaration
[Pure]
public static ILogger<T> GetLogger<T>(this ICompositionContext compositionContext)
Parameters
Type | Name | Description |
---|---|---|
ICompositionContext | compositionContext | The composition context to act on. |
Returns
Type | Description |
---|---|
ILogger<T> | A logger for the provided type. |
Type Parameters
Name | Description |
---|---|
T | The type for which a logger should be created. |
ToCompositionContext(IServiceProvider)
Converts a System.IServiceProvider to a ICompositionContext.
Declaration
public static ICompositionContext ToCompositionContext(this IServiceProvider serviceProvider)
Parameters
Type | Name | Description |
---|---|---|
System.IServiceProvider | serviceProvider | The service provider to act on. |
Returns
Type | Description |
---|---|
ICompositionContext | The service provider as an ICompositionContext. |
ToServiceProvider(ICompositionContext)
Converts a ICompositionContext to a System.IServiceProvider.
Declaration
public static IServiceProvider ToServiceProvider(this ICompositionContext compositionContext)
Parameters
Type | Name | Description |
---|---|---|
ICompositionContext | compositionContext | The composition context to act on. |
Returns
Type | Description |
---|---|
System.IServiceProvider | The composition context as an System.IServiceProvider. |
TryGetExportFactory<T>(ICompositionContext)
Tries to resolve the specified contract type as an export factory.
Declaration
public static IExportFactory<T> TryGetExportFactory<T>(this ICompositionContext compositionContext)
Parameters
Type | Name | Description |
---|---|---|
ICompositionContext | compositionContext | The compositionContext to act on. |
Returns
Type | Description |
---|---|
IExportFactory<T> | An object implementing |
Type Parameters
Name | Description |
---|---|
T | The contract type. |
TryGetExportFactory<T, TMetadata>(ICompositionContext)
Tries to esolve the specified contract type as an export factory with metadata.
Declaration
public static IExportFactory<T, TMetadata> TryGetExportFactory<T, TMetadata>(this ICompositionContext compositionContext)
Parameters
Type | Name | Description |
---|---|---|
ICompositionContext | compositionContext | The compositionContext to act on. |
Returns
Type | Description |
---|---|
IExportFactory<T, TMetadata> | An object implementing |
Type Parameters
Name | Description |
---|---|
T | The contract type. |
TMetadata | The metadata type. |