共用方式為


CachedDataHostItemCollection 類別

表示 CachedDataHostItem 物件的集合,這些物件位於使用 Visual Studio 的 Office 開發工具所建立之文件層級自訂的資料快取中。

繼承階層架構

System.Object
  System.Collections.ObjectModel.Collection<CachedDataHostItem>
    Microsoft.VisualStudio.Tools.Applications.CachedDataHostItemCollection

命名空間:  Microsoft.VisualStudio.Tools.Applications
組件:  Microsoft.VisualStudio.Tools.Applications.ServerDocument (在 Microsoft.VisualStudio.Tools.Applications.ServerDocument.dll 中)

語法

'宣告
<SerializableAttribute> _
<PermissionSetAttribute(SecurityAction.Demand, Name := "FullTrust")> _
Public NotInheritable Class CachedDataHostItemCollection _
    Inherits Collection(Of CachedDataHostItem)
[SerializableAttribute]
[PermissionSetAttribute(SecurityAction.Demand, Name = "FullTrust")]
public sealed class CachedDataHostItemCollection : Collection<CachedDataHostItem>

CachedDataHostItemCollection 型別會公開下列成員。

屬性

  名稱 說明
公用屬性 Count 取得 Collection<T> 中實際包含的項目數目。 (繼承自 Collection<CachedDataHostItem>)。
公用屬性 Item[Int32] 取得或設定在指定索引的項目。 (繼承自 Collection<CachedDataHostItem>)。
公用屬性 Item[String] 取得由命名空間和類別 (來源資料快取處) 所識別的 CachedDataHostItem

回頁首

方法

  名稱 說明
公用方法 Add(String) 將指定的 CachedDataHostItem 加入至集合的結尾。
公用方法 Add(T) 將物件加入至 Collection<T> 的結尾。 (繼承自 Collection<CachedDataHostItem>)。
公用方法 Clear 將所有項目從 Collection<T> 移除。 (繼承自 Collection<CachedDataHostItem>)。
公用方法 Contains(String) 傳回值,指出集合是否包含指定的 CachedDataHostItem
公用方法 Contains(T) 判斷某項目是否在 Collection<T> 中。 (繼承自 Collection<CachedDataHostItem>)。
公用方法 CopyTo 從目標陣列之指定的索引開始,將整個 Collection<T> 複製到相容的一維 Array。 (繼承自 Collection<CachedDataHostItem>)。
公用方法 Equals 判斷指定的物件是否等於目前物件。 (繼承自 Object)。
公用方法 GetEnumerator 傳回 CachedDataHostItemEnumerator,可以用來逐一查看集合的內容。
公用方法 GetHashCode 做為特定型別的雜湊函式。 (繼承自 Object)。
公用方法 GetType 取得目前執行個體的 Type。 (繼承自 Object)。
公用方法 IndexOf 搜尋指定的物件,並傳回整個 Collection<T> 中第一個相符項目之以零起始的索引。 (繼承自 Collection<CachedDataHostItem>)。
公用方法 Insert 將項目插入 Collection<T> 中指定的索引處。 (繼承自 Collection<CachedDataHostItem>)。
公用方法 Remove(String) 從集合中移除指定的 CachedDataHostItem,後者由快取來源資料的命名空間和類別名稱所識別。
公用方法 Remove(T) Collection<T> 移除特定物件的第一個相符項目。 (繼承自 Collection<CachedDataHostItem>)。
公用方法 RemoveAt 移除 Collection<T> 中指定之索引處的項目。 (繼承自 Collection<CachedDataHostItem>)。
公用方法 ToString 傳回表示目前物件的字串。 (繼承自 Object)。

回頁首

明確介面實作

  名稱 說明
明確介面實作私用方法 IList.Add 將項目加入至 IList。 (繼承自 Collection<CachedDataHostItem>)。
明確介面實作私用方法 IList.Contains 判斷 IList 是否包含特定值。 (繼承自 Collection<CachedDataHostItem>)。
明確介面實作私用方法 ICollection.CopyTo 從特定的 Array 索引開始,複製 ICollection 項目至 Array。 (繼承自 Collection<CachedDataHostItem>)。
明確介面實作私用方法 IEnumerable.GetEnumerator 傳回會逐一查看集合的列舉程式。 (繼承自 Collection<CachedDataHostItem>)。
明確介面實作私用方法 IList.IndexOf 判斷 IList 中特定項目的索引。 (繼承自 Collection<CachedDataHostItem>)。
明確介面實作私用方法 IList.Insert 將項目插入 IList 中指定的索引處。 (繼承自 Collection<CachedDataHostItem>)。
明確介面實作私用屬性 IList.IsFixedSize 取得值,指出 IList 是否有固定的大小。 (繼承自 Collection<CachedDataHostItem>)。
明確介面實作私用屬性 ICollection<T>.IsReadOnly 取得值,指出 ICollection<T> 是否唯讀。 (繼承自 Collection<CachedDataHostItem>)。
明確介面實作私用屬性 IList.IsReadOnly 取得值,指出 IList 是否唯讀。 (繼承自 Collection<CachedDataHostItem>)。
明確介面實作私用屬性 ICollection.IsSynchronized 取得值,這個值表示對 ICollection 的存取是否同步 (安全執行緒)。 (繼承自 Collection<CachedDataHostItem>)。
明確介面實作私用屬性 IList.Item 取得或設定在指定索引的項目。 (繼承自 Collection<CachedDataHostItem>)。
明確介面實作私用方法 IList.Remove IList 移除特定物件之第一個符合的元素。 (繼承自 Collection<CachedDataHostItem>)。
明確介面實作私用屬性 ICollection.SyncRoot 取得可用來同步存取 ICollection 的物件。 (繼承自 Collection<CachedDataHostItem>)。

回頁首

備註

使用 HostItems 屬性來取得具有快取資料之方案文件的 CachedDataHostItemCollection。

如需快取文件層級自訂中的資料之詳細資訊,請參閱快取資料存取伺服器文件中的資料

執行緒安全

這個型別的任何 Public static (在 Visual Basic 中為 Shared) 成員都具備執行緒安全。不保證任何執行個體成員是安全執行緒。

請參閱

參考

Microsoft.VisualStudio.Tools.Applications 命名空間

其他資源

使用 ServerDocument 類別管理伺服器上的文件

快取資料

存取伺服器文件中的資料