CachedDataHostItemCollection.Add 方法 (String)

将指定的 CachedDataHostItem 添加到集合的末尾。

命名空间:  Microsoft.VisualStudio.Tools.Applications
程序集:  Microsoft.VisualStudio.Tools.Applications.ServerDocument(在 Microsoft.VisualStudio.Tools.Applications.ServerDocument.dll 中)

语法

声明
Public Function Add ( _
    hostItemId As String _
) As CachedDataHostItem
public CachedDataHostItem Add(
    string hostItemId
)

参数

  • hostItemId
    类型:System.String
    在其中缓存源数据的命名空间和类。

返回值

类型:Microsoft.VisualStudio.Tools.Applications.CachedDataHostItem
已添加到集合末尾的 CachedDataHostItem

异常

异常 条件
InvalidOperationException

与 hostItemId 对应的 CachedDataHostItem 已存在于集合中。

备注

hostItemId 参数是一个字符串,它指定包含缓存数据的解决方案文档中的命名空间和类。 命名空间和类名之间用句点 (.) 分隔,例如,“Excel工作簿1.当前工作簿”。

若要将 CachedDataHostItem 添加到集合中特定的索引位置处,应使用 Insert 方法。

.NET Framework 安全性

请参见

参考

CachedDataHostItemCollection 类

Add 重载

Microsoft.VisualStudio.Tools.Applications 命名空间