다음을 통해 공유


CachedAttribute Class

Definition

Instructs the Visual Studio Tools for Office runtime to add the specified data object to the data cache in the document.

public ref class CachedAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property)]
public sealed class CachedAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property)>]
type CachedAttribute = class
    inherit Attribute
Public NotInheritable Class CachedAttribute
Inherits Attribute
Inheritance
CachedAttribute
Attributes

Remarks

This attribute can only be used in a document-level customization for Word or Excel created by using the Office development tools in Visual Studio.

To add an object to the data cache in a document, the object must have a public type that meets the requirements of XmlSerializer. For more information about adding objects to the data cache, see Caching Data. For more information about using attributes, see Attributes.

If you want to have greater control over the caching behavior of the data object, you can implement the ICachedType interface in the type of the object.

Constructors

CachedAttribute()

Initializes a new instance of the CachedAttribute class.

Applies to