This documentation is archived and is not being maintained.

CollectionAdapters.ToIList<TContract, TView> Method (IListContract<TContract>, Converter<TContract, TView>, Converter<TView, TContract>)

Converts a specified IListContract<T> collection to an IList<T> collection by using converter adapters.

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

public static IList<TView> ToIList<TContract, TView>(
	IListContract<TContract> collection,
	Converter<TContract, TView> contractViewAdapter,
	Converter<TView, TContract> viewContractAdapter

Type Parameters


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


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


Type: System.AddIn.Contract.IListContract<TContract>
The collection to pass to the other side of the pipeline.
Type: System.Converter<TContract, TView>
A converter that adapts the data from the type defined in the contract to the type expected in the view.
Type: System.Converter<TView, TContract>
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<TView>
The converted collection.

Use this method overload for IListContract<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<T> collection. It will have a lifetime token for the remote IListContract<T>.

.NET Framework

Supported in: 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.