次の方法で共有


IVsFontAndColorUtilities Interface

Provides tools for working with the input and output data used by the methods of the Visual StudioFont and Color mechanism.

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

Syntax

'宣言
<InterfaceTypeAttribute()> _
<GuidAttribute("A356A017-07EE-4D06-ACDE-FEFDBB49EB50")> _
Public Interface IVsFontAndColorUtilities
'使用
Dim instance As IVsFontAndColorUtilities
[InterfaceTypeAttribute()]
[GuidAttribute("A356A017-07EE-4D06-ACDE-FEFDBB49EB50")]
public interface IVsFontAndColorUtilities
[InterfaceTypeAttribute()]
[GuidAttribute(L"A356A017-07EE-4D06-ACDE-FEFDBB49EB50")]
public interface class IVsFontAndColorUtilities
public interface IVsFontAndColorUtilities

Remarks

The methods of the IVsFontAndColorUtilities interface allow a VSPackage to provide Font and Color support tools for working with FontInfo, __FONTCOLORFLAGS, __FCFONTFLAGS, and LOGFONTW, which are used to specify and modify font and color information.

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 settings and the currency of future Fonts and Colors queries.

Note

Many of the methods in this interface work with color data stored as a COLORREF, consistent with the Windows 32 SDK GetSysColor function. A COLORREF (RGB) has the hex format of 0x00bbggrr. Managed code can obtain functionality equivalent to GetSysColor with SystemColors and convert between COLORREF and the System.Drawing.Color structure using M:System.Drawing.ColorTranslator.FromWin32 and M:System.Drawing.ColorTranslator.ToWin32.

Notes to Callers:

The IVsFontAndColorUtilities is obtained from the SVsFontAndColorStorage service implementation.

VSPackages developed using managed code can obtain an IVsFontAndColorCacheManager interface by calling GetService with an argument of SVsFontAndColorStorage and casting to IVsFontAndColorUtilities:

    IVsFontAndColorUtilities store=null;
    store=GetService(typeof(SVsFontAndColorStorage)) as IVsFontAndColorUtilities;
    if (store == null ){
        throw new ApplicationException("Unable to obtain IVsFontAndColorUtilities Interface");

}

COM programmers can obtain an IVsFontAndColorCacheManager interface by calling QueryService with

a service ID SID_SVsFontAndColorStorage and the interface ID IID_IVsFontAndColorUtilities:

    CComPtr<IVsFontAndColorUtilities> srpFCCacheMgr;
    pSP->QueryService(SID_SVsFontAndColorStorage , IID_IVsFontAndColorUtilities , (void**)&srpFCCacheMgr);
    VSASSERT(SUCCEEDED(hr), " IVsFontAndColorUtilities not provided");

See Also

Concepts

Fonts

Reference

IVsFontAndColorUtilities Members

Microsoft.VisualStudio.Shell.Interop Namespace