Show / Hide Table of Contents

Class CompositionContextExtensions

Extension methods for ICompositionContext.

Inheritance
System.Object
CompositionContextExtensions
Inherited Members
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: Kephas.Composition
Assembly: Kephas.Core.dll
Syntax
public static class CompositionContextExtensions

Methods

| Improve this Doc View Source

GetExportFactories(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 contractType.

| Improve this Doc View Source

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 contractType with metadataType metadata.

| Improve this Doc View Source

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 T.

Type Parameters
Name Description
T

The contract type.

| Improve this Doc View Source

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 T.

Type Parameters
Name Description
T

The contract type.

TMetadata

The metadata type.

| Improve this Doc View Source

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 contractType.

| Improve this Doc View Source

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 contractType with metadataType metadata.

| Improve this Doc View Source

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 T.

Type Parameters
Name Description
T

The contract type.

| Improve this Doc View Source

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 T.

Type Parameters
Name Description
T

The contract type.

TMetadata

The metadata type.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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 T, or null.

Type Parameters
Name Description
T

The contract type.

| Improve this Doc View Source

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 T, or null.

Type Parameters
Name Description
T

The contract type.

TMetadata

The metadata type.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX