Rediger

Del via


ContractAdapter.ContractToViewAdapter Method

Definition

Obtains a host view of an add-in if a suitable host-side adapter is found at a specified location.

Overloads

ContractToViewAdapter<TView>(ContractHandle, PipelineStoreLocation)

Obtains a host view of an add-in if a suitable host-side adapter is found at a location specified by a value from the PipelineStoreLocation enumeration.

ContractToViewAdapter<TView>(ContractHandle, String)

Obtains a host view of an add-in if a suitable host-side adapter is found at a location specified by a path.

ContractToViewAdapter<TView>(ContractHandle, PipelineStoreLocation)

Obtains a host view of an add-in if a suitable host-side adapter is found at a location specified by a value from the PipelineStoreLocation enumeration.

public:
generic <typename TView>
 static TView ContractToViewAdapter(System::AddIn::Pipeline::ContractHandle ^ contract, System::AddIn::Hosting::PipelineStoreLocation location);
public static TView ContractToViewAdapter<TView> (System.AddIn.Pipeline.ContractHandle contract, System.AddIn.Hosting.PipelineStoreLocation location);
static member ContractToViewAdapter : System.AddIn.Pipeline.ContractHandle * System.AddIn.Hosting.PipelineStoreLocation -> 'View
Public Shared Function ContractToViewAdapter(Of TView) (contract As ContractHandle, location As PipelineStoreLocation) As TView

Type Parameters

TView

The type that defines the host view of the add-in.

Parameters

contract
ContractHandle

A handle to the contract used by the add-in to be shared.

location
PipelineStoreLocation

The host's application base.

Returns

TView

The host view of the add-in that is shared.

Exceptions

location is invalid.

Remarks

In this scenario, an entity has an instance of a contract and wants to adapt it to a particular view. Use this method to query the system to find and instantiate an adapter to convert into that view.

Applies to

ContractToViewAdapter<TView>(ContractHandle, String)

Obtains a host view of an add-in if a suitable host-side adapter is found at a location specified by a path.

public:
generic <typename TView>
 static TView ContractToViewAdapter(System::AddIn::Pipeline::ContractHandle ^ contract, System::String ^ pipelineRoot);
public static TView ContractToViewAdapter<TView> (System.AddIn.Pipeline.ContractHandle contract, string pipelineRoot);
static member ContractToViewAdapter : System.AddIn.Pipeline.ContractHandle * string -> 'View
Public Shared Function ContractToViewAdapter(Of TView) (contract As ContractHandle, pipelineRoot As String) As TView

Type Parameters

TView

The type that defines the host view of the add-in.

Parameters

contract
ContractHandle

A handle to the contract used by the add-in to be shared.

pipelineRoot
String

A path to the add-in store.

Returns

TView

The host view of the add-in that is shared.

Remarks

In this scenario, an entity has an instance of a contract and wants to adapt it to a particular view. Use this method to query the system to find and instantiate an adapter to convert into that view.

Applies to