CollectionAdapters.ToIList(Of TContract, TView) Method (IListContract(Of TContract), Converter(Of TContract, TView), Converter(Of TView, TContract))


Converts a specified IListContract(Of T) collection to an IList(Of T) collection by using converter adapters.

Namespace:   System.AddIn.Pipeline
Assembly:  System.AddIn (in System.AddIn.dll)

Public Shared Function ToIList(Of TContract, TView) (
	collection As IListContract(Of TContract),
	contractViewAdapter As Converter(Of TContract, TView),
	viewContractAdapter As Converter(Of TView, TContract)
) As IList(Of TView)


Type: System.AddIn.Contract.IListContract(Of TContract)

The collection to pass to the other side of the pipeline.

Type: System.Converter(Of TContractTView)

A converter that adapts the data from the type defined in the contract to the type expected in the view.

Type: System.Converter(Of TViewTContract)

A converter that adapts the data from the type defined in the view to the type expected by the contract.

Return Value

Type: System.Collections.Generic.IList(Of TView)

The converted collection.

Type Parameters


The type that defines the view of the objects in the list.


The type that defines the contract for passing objects of type TView across the isolation boundary.

Use this method overload for IListContract(Of T) collections that contain types that must be adapted before they can be passed to the add-in or host (rather than simple serializable types that can be passed directly). The host application or add-in can use the returned IList(Of T) collection. It will have a lifetime token for the remote IListContract(Of T).

.NET Framework
Available since 3.5
Return to top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft