CachedAttribute 类 (2007 system)

更新:2007 年 11 月

指示 Visual Studio Tools for Office 运行库将指定的数据对象添加到文档的数据缓存中。

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

语法

声明
<AttributeUsageAttribute(AttributeTargets.Property Or AttributeTargets.Field)> _
Public NotInheritable Class CachedAttribute _
    Inherits Attribute
用法
Dim instance As CachedAttribute
[AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field)]
public sealed class CachedAttribute : Attribute

备注

此属性只能在使用 Visual Studio Tools for Office 创建的文档级自定义项中使用。

若要将对象添加到文档的数据缓存中,该对象必须具有满足 XmlSerializer 的要求的公共类型。有关向数据缓存中添加对象的更多信息,请参见缓存数据。有关使用属性的更多信息,请参见 利用属性扩展元数据

如果您希望更大程度地控制数据对象的缓存行为,可以在对象的类型中实现 ICachedType 接口。

继承层次结构

System.Object
  System.Attribute
    Microsoft.VisualStudio.Tools.Applications.Runtime.CachedAttribute

线程安全

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

另请参见

参考

CachedAttribute 成员

Microsoft.VisualStudio.Tools.Applications.Runtime 命名空间

其他资源

缓存数据

利用属性扩展元数据