IVsFontAndColorStorage2 接口

允许 VSPackage 管理注册表字体和颜色项。

命名空间:  Microsoft.VisualStudio.Shell.Interop
程序集:  Microsoft.VisualStudio.Shell.Interop.8.0(在 Microsoft.VisualStudio.Shell.Interop.8.0.dll 中)

语法

声明
<InterfaceTypeAttribute()> _
<GuidAttribute("1EE6C79A-B763-42E6-AC95-FD0CC00DE315")> _
Public Interface IVsFontAndColorStorage2
[InterfaceTypeAttribute()]
[GuidAttribute("1EE6C79A-B763-42E6-AC95-FD0CC00DE315")]
public interface IVsFontAndColorStorage2

IVsFontAndColorStorage2 类型公开以下成员。

方法

  名称 说明
公共方法 RevertAllItemsToDefault 还原所有注册表字体和颜色项设置为默认值。
公共方法 RevertFontToDefault 还原任何字体注册表项设置为默认值。
公共方法 RevertItemToDefault 还原指示的注册表字体或颜色项为其默认值。

页首

备注

Visual Studio 环境提供此接口的实现。此接口允许 VSPackage 管理注册表字体和颜色项。与 IVsFontAndColorStorage 界面结合使用此接口。

对实现者的说明

COM 程序员可以通过调用 QueryService 获取一 IVsFontAndColorStorage2 接口与服务标识符 SID_SVsFontAndColorStorage2 和接口 ID IID_IVsFontAndColorStorage2:

    CComPtr<IVsFontAndColorStorage2>  pStorage;
    hr = pSP->QueryService(SID_SVsFontAndColorStorage2, IID_IVsFontAndColorStorage2, (void**)&pStorage);
    VSASSERT(SUCCEEDED(hr), "IVsFontAndColorStorage2 not provided");

Vspackage 开发了使用托管代码可以通过调用 GetService 获取一 IVsFontAndColorStorage2 接口与 SVsFontAndColorStorage2的参数:

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

请参见

参考

Microsoft.VisualStudio.Shell.Interop 命名空间

IVsFontAndColorStorage