IVsFontAndColorUtilities Interface
Provides tools for working with the input and output data used by the methods of the Visual Studio Font and Color mechanism.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)
Syntax
'宣告
<GuidAttribute("A356A017-07EE-4D06-ACDE-FEFDBB49EB50")> _
<InterfaceTypeAttribute()> _
Public Interface IVsFontAndColorUtilities
'用途
Dim instance As IVsFontAndColorUtilities
[GuidAttribute("A356A017-07EE-4D06-ACDE-FEFDBB49EB50")]
[InterfaceTypeAttribute()]
public interface IVsFontAndColorUtilities
[GuidAttribute(L"A356A017-07EE-4D06-ACDE-FEFDBB49EB50")]
[InterfaceTypeAttribute()]
public interface class IVsFontAndColorUtilities
[<GuidAttribute("A356A017-07EE-4D06-ACDE-FEFDBB49EB50")>]
[<InterfaceTypeAttribute()>]
type IVsFontAndColorUtilities = interface end
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.
注意
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
Reference
IVsFontAndColorUtilities Members
Microsoft.VisualStudio.Shell.Interop Namespace