IListContract<T> 介面
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
代表一個由合約定義的通用型別清單,用於主機與外掛間傳遞該型別的集合。
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
類型參數
- T
清單中物件的合約類型。
- 實作
備註
該 CollectionAdapters 類別使用 IListContract<T> 介面在主機與外掛之間雙向傳遞集合。 建議你直接使用這個 CollectionAdapters 類別,而不是直接在程式碼中使用這個類別。 舉例請參見 《攻略:主機與外掛之間的傳遞集合。
此類別可用於透過應用程式域間的參考傳遞物件,因為物件並未序列化。
方法
| 名稱 | Description |
|---|---|
| AcquireLifetimeToken() |
規定合約在客戶撤銷合約前仍可取得。 (繼承來源 IContract) |
| Add(T) |
將物件加入 IListContract<T> 集合。 |
| Clear() |
移除集合中 IListContract<T> 的所有物件。 |
| Contains(T) |
判斷特定項目是否屬於 IListContract<T> 收藏。 |
| GetCount() |
取得收藏中的 IListContract<T> 項目數量。 |
| GetEnumeratorContract() |
回傳一個遍 IListContract<T> 歷集合的列舉器。 |
| GetIsReadOnly() |
判斷集合 IListContract<T> 是否為唯讀。 |
| GetItem(Int32) |
回傳集合指定索引 IListContract<T> 的項目。 |
| GetRemoteHashCode() |
回傳一個雜湊碼。IContract (繼承來源 IContract) |
| IndexOf(T) |
回傳集合中 IListContract<C> 特定項目的索引。 |
| Insert(Int32, T) |
在集合中 IListContract<T> 插入指定的索引項目。 |
| QueryContract(String) |
回傳由該合約實作的合約。 (繼承來源 IContract) |
| RemoteEquals(IContract) |
表示指定的契約是否等於此。IContract (繼承來源 IContract) |
| RemoteToString() |
回傳當前 IContract的字串表示。 (繼承來源 IContract) |
| Remove(T) |
從指定類型的集合中移除一個項目 IListContract<T> 。 |
| RemoveAt(Int32) |
移除集合中 IListContract<T> 指定索引的項目。 |
| RevokeLifetimeToken(Int32) |
規定合約不再對客戶開放。 (繼承來源 IContract) |
| SetItem(Int32, T) |
將該項目設定在集合中 IListContract<T> 指定的索引位置。 |