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
受保护的属性 Items 获取 Collection<T> 周围的 IList<T> 包装。 (继承自 Collection<CachedDataHostItem>。)

页首

方法

  名称 说明
公共方法 Add(String) 将指定的 CachedDataHostItem 添加到集合的末尾。
公共方法 Add(T) 将对象添加到 Collection<T> 的结尾处。 (继承自 Collection<CachedDataHostItem>。)
公共方法 Clear Collection<T> 中移除所有元素。 (继承自 Collection<CachedDataHostItem>。)
受保护的方法 ClearItems Collection<T> 中移除所有元素。 (继承自 Collection<CachedDataHostItem>。)
公共方法 Contains(String) 返回一个指示集合是否包含指定的 CachedDataHostItem 的值。
公共方法 Contains(T) 确定某元素是否在 Collection<T> 中。 (继承自 Collection<CachedDataHostItem>。)
公共方法 CopyTo 从目标数组的指定索引处开始将整个 Collection<T> 复制到兼容的一维 Array。 (继承自 Collection<CachedDataHostItem>。)
公共方法 Equals 确定指定的 Object 是否等于当前的 Object。 (继承自 Object。)
受保护的方法 Finalize 允许对象在“垃圾回收”回收之前尝试释放资源并执行其他清理操作。 (继承自 Object。)
公共方法 GetEnumerator 返回可用于循环访问集合内容的 CachedDataHostItemEnumerator
公共方法 GetHashCode 用作特定类型的哈希函数。 (继承自 Object。)
公共方法 GetType 获取当前实例的 Type。 (继承自 Object。)
公共方法 IndexOf 搜索指定的对象,并返回整个 Collection<T> 中第一个匹配项的从零开始的索引。 (继承自 Collection<CachedDataHostItem>。)
公共方法 Insert 将元素插入 Collection<T> 的指定索引处。 (继承自 Collection<CachedDataHostItem>。)
受保护的方法 InsertItem 将元素插入 Collection<T> 的指定索引处。 (继承自 Collection<CachedDataHostItem>。)
受保护的方法 MemberwiseClone 创建当前 Object 的浅表副本。 (继承自 Object。)
公共方法 Remove(String) 从集合中移除指定的 CachedDataHostItem,它由缓存了源数据的命名空间和类名标识。
公共方法 Remove(T) Collection<T> 中移除特定对象的第一个匹配项。 (继承自 Collection<CachedDataHostItem>。)
公共方法 RemoveAt 移除 Collection<T> 的指定索引处的元素。 (继承自 Collection<CachedDataHostItem>。)
受保护的方法 RemoveItem 移除 Collection<T> 的指定索引处的元素。 (继承自 Collection<CachedDataHostItem>。)
受保护的方法 SetItem 替换指定索引处的元素。 (继承自 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。

有关在文档级自定义项中缓存数据的更多信息,请参见缓存数据访问服务器上的文档数据

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

请参见

参考

Microsoft.VisualStudio.Tools.Applications 命名空间

其他资源

使用 ServerDocument 类管理服务器上的文档

缓存数据

访问服务器上的文档数据