CompositionContext.GetExport 方法

定义

重载

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)

检索与指定协定匹配的导出。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

参数

contract
CompositionContract

要匹配的协定。The contract to match.

返回

Object

导出的值。The exported value.

例外

未找到 contract 的导出。No export was found for contract.

适用于

GetExport(Type)

检索与指定类型匹配的导出。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

参数

exportType
Type

要匹配的类型。The type to match.

返回

Object

导出的值。The exported value.

例外

未找到 exportType 的导出。No export was found for exportType.

适用于

GetExport(Type, String)

检索与指定名称和类型匹配的导出。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

参数

exportType
Type

要匹配的类型。The type to match.

contractName
String

要匹配的名称。The name to match.

返回

Object

导出的值。The exported value.

例外

未找到 exportTypecontractName 的导出。No export was found for exportType and contractName.

适用于

GetExport<TExport>()

检索与指定泛型类型参数匹配的导出。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

类型参数

TExport

要匹配的类型。The type to match.

返回

TExport

导出的值。The exported value.

例外

未找到 TExport 的导出。No export was found for TExport.

适用于

GetExport<TExport>(String)

检索与指定泛型类型参数和协定名称匹配的导出。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

类型参数

TExport

要匹配的类型。The type to match.

参数

contractName
String

要匹配的名称。The name to match.

返回

TExport

导出的值。The exported value.

例外

未找到 TExportcontractName 的导出。No export was found for TExport and contractName.

适用于