Partager via


IVsFontAndColorCacheManager.CheckCache(Guid, Int32) Method

Definition

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

public:
 int CheckCache(Guid % rguidCategory, [Runtime::InteropServices::Out] int % pfHasData);
public int CheckCache (ref Guid rguidCategory, out int pfHasData);
abstract member CheckCache : Guid * int -> int
Public Function CheckCache (ByRef rguidCategory As Guid, ByRef pfHasData As Integer) As Integer

Parameters

rguidCategory
Guid

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

pfHasData
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.

Returns

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

Examples

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);  
    }  
}  

Remarks

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

COM Signature

From vsshell80.idl:

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

Applies to