IVsFontAndColorCacheManager::CheckCache Method (Guid, Int32)

 

Determines if a given Category's state is cached and current.

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

int CheckCache(
	[InAttribute] Guid% rguidCategory,
	[OutAttribute] int% pfHasData
)

Parameters

rguidCategory
Type: System::Guid

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

pfHasData
Type: System::Int32

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

If pfHasData is true, the Category's state is current and cached.

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

Return Value

Type: System::Int32

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

If a Category's state is not up to date, the Visual Studio environment clears any of its cached information by calling ClearCache.

From vsshell80.idl:

HRESULT IVsFontAndColorCacheManager::CheckCache(
   [in] REFGUID rguidCategory,
   [out] BOOL *pfHasData
);

RESULT hr = S_OK;
CComPtr<IVsFontAndColorCacheManager> spCacheManager;
BOOL fCached = FALSE;

// Check to see if the info for this category is cached, refreshing the cache if necessary.
if (SUCCEEDED(GetFontColorCacheManager(&spCacheManager)))
{
    spCacheManager->CheckCache(rguidCategory, &fCached);
    if (!fCached && fAllowCacheRefresh && fAllowPackageLoad)
    {
        spCacheManager->RefreshCache(rguidCategory);
        spCacheManager->CheckCache(rguidCategory, &fCached);
    }
}
Return to top
Show: