Share via


IVsFontAndColorCacheManager Interface

Controls the caching of font and color settings.

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

Syntax

'Declaration
<GuidAttribute("55D3D8C8-F08C-4B31-B70D-FCC52468A5B2")> _
<InterfaceTypeAttribute()> _
Public Interface IVsFontAndColorCacheManager
[GuidAttribute("55D3D8C8-F08C-4B31-B70D-FCC52468A5B2")]
[InterfaceTypeAttribute()]
public interface IVsFontAndColorCacheManager
[GuidAttribute(L"55D3D8C8-F08C-4B31-B70D-FCC52468A5B2")]
[InterfaceTypeAttribute()]
public interface class IVsFontAndColorCacheManager
[<GuidAttribute("55D3D8C8-F08C-4B31-B70D-FCC52468A5B2")>]
[<InterfaceTypeAttribute()>]
type IVsFontAndColorCacheManager =  interface end
public interface IVsFontAndColorCacheManager

The IVsFontAndColorCacheManager type exposes the following members.

Methods

  Name Description
Public method CheckCache Determines if a given Category's state is cached and current.
Public method CheckCacheable Determines if a given Category's state can be cached.
Public method ClearAllCaches Clears all Categories' state information from the Fonts and Colors cache.
Public method ClearCache Clears a given Category's state information from the Fonts and Colors cache.
Public method RefreshCache Force the Visual Studio environment to update cached Fonts and Colors information with the current state data of a given Category.

Top

Remarks

The Visual Studio Tools Options page's Fonts and Colors default setting information is cached to avoid unnecessarily loading VSPackages to get or set Fonts and Colors info.

Notes to Callers

The Visual Studio environment implements the IVsFontAndColorCacheManager interface.

COM programmers can obtain an IVsFontAndColorCacheManager interface by calling QueryService with

a service ID SID_SVsFontAndColorCacheManager and the interface ID IID_IVsFontAndColorCacheManager:

    CComPtr<IVsFontAndColorCacheManager> srpFCCacheMgr;
    pSP->QueryService(SID_SVsFontAndColorCacheManager , IID_IVsFontAndColorCacheManager , (void**)&srpFCCacheMgr);
    VSASSERT(SUCCEEDED(hr), " IVsFontAndColorCacheManager not provided");

VSPackages developed using managed code can obtain an IVsFontAndColorCacheManager interface by calling GetService with an argument of SVsFontAndColorCacheManager:

    IVsFontAndColorCacheManager store=null;
    store=GetService(typeof(SVsFontAndColorCacheManager)) as IVsFontAndColorCacheManager;
    if (store == null ){
        throw new ApplicationException("Unable to obtain IVsFontAndColorCacheManager Interface");
    }

If a VSPackage providing Fonts and Colors changes its default settings, it must call ClearCache or ClearAllCaches. This will force the reloading of Fonts and Colors providers, ensure the propagation of its setting, and the currency of future Fonts and Colors queries.

See Also

Reference

Microsoft.VisualStudio.Shell.Interop Namespace

Other Resources

Fonts