共用方式為


IVsFontAndColorCacheManager.CheckCacheable Method

Determines if a given Category's state can be cached.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)

Syntax

'Declaration
Function CheckCacheable ( _
    ByRef rguidCategory As Guid, _
    <OutAttribute> ByRef pfCacheable As Integer _
) As Integer
int CheckCacheable(
    ref Guid rguidCategory,
    out int pfCacheable
)
int CheckCacheable(
    [InAttribute] Guid% rguidCategory, 
    [OutAttribute] int% pfCacheable
)
abstract CheckCacheable : 
        rguidCategory:Guid byref * 
        pfCacheable:int byref -> int
function CheckCacheable(
    rguidCategory : Guid, 
    pfCacheable : int
) : int

Parameters

  • rguidCategory
    Type: Guid%

    [in] Specifies the GUID of the Category of Display Items whose caching state is being checked.

  • pfCacheable
    Type: Int32%

    [out] Flag indicating if a Category's default Fonts and Colors state can be cached.

    If pfHasData is true, the Category's state can be cached.

    If pfHasData is false, the Category's state cannot be cached.

Return Value

Type: Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

By default, the Fonts and Colors state of all categories is cacheable.

However, a VSPackage can prevent their settings from being cached by creating a registry the registry entry [HKLM\SOFTWARE\Microsoft \Visual Studio\<Visual Studio version>\FontAndColors\<Category>\Cacheable] and settings its value to 0.

Here <Category> is the non-localized name of the category and <Version> is the version of Visual Studio, for example 8.0.

Note

The root path of HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\<Version> can be overridden with an alternate root when the Visual Studio shell is initialized. For more information see, Command-Line Switches (Visual Studio SDK).

COM Signature

From vsshell80.idl:

HRESULT IVsFontAndColorCacheManager::CheckCacheable(
   [in] REFGUID rguidCategory,
   [out] BOOL *pfCacheable
);

.NET Framework Security

See Also

Reference

IVsFontAndColorCacheManager Interface

Microsoft.VisualStudio.Shell.Interop Namespace

IVsFontAndColorCacheManager

Other Resources

Fonts