CachedAttribute Class (2007 System)

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

Namespace:  Microsoft.VisualStudio.Tools.Applications.Runtime
Assembly:  Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0 (in Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0.dll)

Syntax

'Declaration
<AttributeUsageAttribute(AttributeTargets.Property Or AttributeTargets.Field)> _
Public NotInheritable Class CachedAttribute _
    Inherits Attribute
'Usage
Dim instance As CachedAttribute
[AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field)]
public sealed class CachedAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Property|AttributeTargets::Field)]
public ref class CachedAttribute sealed : public Attribute
public final class CachedAttribute extends Attribute

Remarks

This attribute can only be used in a document-level customization created by using Visual Studio Tools for Office.

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 Extending Metadata Using 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.

Inheritance Hierarchy

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

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

CachedAttribute Members

Microsoft.VisualStudio.Tools.Applications.Runtime Namespace

Other Resources

Caching Data

Extending Metadata Using Attributes