Jagamisviis:


CompositionContext.GetExport Method

Definition

Overloads

GetExport(CompositionContract)

Retrieves the export that matches the specified contract.

GetExport(Type)

Retrieves the export that matches the specified type.

GetExport(Type, String)

Retrieves the export that matches the specified name and type.

GetExport<TExport>()

Retrieves the export that matches the specified generic type parameter.

GetExport<TExport>(String)

Retrieves the export that matches the specified generic type parameter and contract name.

GetExport(CompositionContract)

Source:
CompositionContext.cs
Source:
CompositionContext.cs

Retrieves the export that matches the specified contract.

public:
 System::Object ^ GetExport(System::Composition::Hosting::Core::CompositionContract ^ contract);
public object GetExport (System.Composition.Hosting.Core.CompositionContract contract);
member this.GetExport : System.Composition.Hosting.Core.CompositionContract -> obj
Public Function GetExport (contract As CompositionContract) As Object

Parameters

contract
CompositionContract

The contract to match.

Returns

The exported value.

Exceptions

No export was found for contract.

Applies to

GetExport(Type)

Source:
CompositionContext.cs
Source:
CompositionContext.cs

Retrieves the export that matches the specified type.

public:
 System::Object ^ GetExport(Type ^ exportType);
public object GetExport (Type exportType);
member this.GetExport : Type -> obj
Public Function GetExport (exportType As Type) As Object

Parameters

exportType
Type

The type to match.

Returns

The exported value.

Exceptions

No export was found for exportType.

Applies to

GetExport(Type, String)

Source:
CompositionContext.cs
Source:
CompositionContext.cs

Retrieves the export that matches the specified name and type.

public:
 System::Object ^ GetExport(Type ^ exportType, System::String ^ contractName);
public object GetExport (Type exportType, string contractName);
member this.GetExport : Type * string -> obj
Public Function GetExport (exportType As Type, contractName As String) As Object

Parameters

exportType
Type

The type to match.

contractName
String

The name to match.

Returns

The exported value.

Exceptions

No export was found for exportType and contractName.

Applies to

GetExport<TExport>()

Source:
CompositionContext.cs
Source:
CompositionContext.cs

Retrieves the export that matches the specified generic type parameter.

public:
generic <typename TExport>
 TExport GetExport();
public TExport GetExport<TExport> ();
member this.GetExport : unit -> 'Export
Public Function GetExport(Of TExport) () As TExport

Type Parameters

TExport

The type to match.

Returns

TExport

The exported value.

Exceptions

No export was found for TExport.

Applies to

GetExport<TExport>(String)

Source:
CompositionContext.cs
Source:
CompositionContext.cs

Retrieves the export that matches the specified generic type parameter and contract name.

public:
generic <typename TExport>
 TExport GetExport(System::String ^ contractName);
public TExport GetExport<TExport> (string contractName);
member this.GetExport : string -> 'Export
Public Function GetExport(Of TExport) (contractName As String) As TExport

Type Parameters

TExport

The type to match.

Parameters

contractName
String

The name to match.

Returns

TExport

The exported value.

Exceptions

No export was found for TExport and contractName.

Applies to