IListContract<T> IListContract<T> IListContract<T> IListContract<T> Interface


Represents a generic list of types that are defined by a contract and are used to pass collections of that contract type between a host and an add-in.

generic <typename T>
public interface class IListContract : System::AddIn::Contract::IContract
public interface IListContract<T> : System.AddIn.Contract.IContract
type IListContract<'T> = interface
    interface IContract
Public Interface IListContract(Of T)
Implements IContract

Type Parameters


The contract type of the objects in the list.



The CollectionAdapters class uses an IListContract<T> interface to pass collections, in both directions, between the host and the add-in. It is recommended that you use the CollectionAdapters class instead of using this class directly in your code. For an example, see Walkthrough: Passing Collections Between Hosts and Add-Ins.

This class can be used to pass objects by reference between application domains because the objects are not serialized.


AcquireLifetimeToken() AcquireLifetimeToken() AcquireLifetimeToken() AcquireLifetimeToken()

Specifies that the contract is accessible to a client until the client revokes the contract.

(Inherited from IContract)
Add(T) Add(T) Add(T) Add(T)

Adds an object to an IListContract<T> collection.

Clear() Clear() Clear() Clear()

Removes all objects from an IListContract<T> collection.

Contains(T) Contains(T) Contains(T) Contains(T)

Determines whether a specific item is in an IListContract<T> collection.

GetCount() GetCount() GetCount() GetCount()

Gets the number of items in an IListContract<T> collection.

GetEnumeratorContract() GetEnumeratorContract() GetEnumeratorContract() GetEnumeratorContract()

Returns an enumerator that iterates through an IListContract<T> collection.

GetIsReadOnly() GetIsReadOnly() GetIsReadOnly() GetIsReadOnly()

Determines whether an IListContract<T> collection is read-only.

GetItem(Int32) GetItem(Int32) GetItem(Int32) GetItem(Int32)

Returns the item at the specified index of an IListContract<T> collection.

GetRemoteHashCode() GetRemoteHashCode() GetRemoteHashCode() GetRemoteHashCode()

Returns a hash code for the IContract.

(Inherited from IContract)
IndexOf(T) IndexOf(T) IndexOf(T) IndexOf(T)

Returns the index of a specific item in an IListContract<C> collection.

Insert(Int32, T) Insert(Int32, T) Insert(Int32, T) Insert(Int32, T)

Inserts an item at the specified index in an IListContract<T> collection.

QueryContract(String) QueryContract(String) QueryContract(String) QueryContract(String)

Returns a contract that is implemented by this contract.

(Inherited from IContract)
RemoteEquals(IContract) RemoteEquals(IContract) RemoteEquals(IContract) RemoteEquals(IContract)

Indicates whether the specified contract is equal to this IContract.

(Inherited from IContract)
RemoteToString() RemoteToString() RemoteToString() RemoteToString()

Returns a string representation of the current IContract.

(Inherited from IContract)
Remove(T) Remove(T) Remove(T) Remove(T)

Removes an item from an IListContract<T> collection of a specified type.

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

Removes the item at the specified index in an IListContract<T> collection.

RevokeLifetimeToken(Int32) RevokeLifetimeToken(Int32) RevokeLifetimeToken(Int32) RevokeLifetimeToken(Int32)

Specifies that the contract is no longer accessible to a client.

(Inherited from IContract)
SetItem(Int32, T) SetItem(Int32, T) SetItem(Int32, T) SetItem(Int32, T)

Sets the item at the specified index in an IListContract<T> collection.

Applies to