CachedAttribute 類別 (2007 系統)

更新: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

執行緒安全

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

請參閱

參考

CachedAttribute 成員

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

其他資源

快取資料

使用屬性擴充中繼資料