简体   繁体   English

如何获取Visual Studio 2017的当前主题

[英]How to get current theme for Visual Studio 2017

I'm looking for a way to retrieve the current theme for the VS 2017. The older versions of VS stored in Windows Registry but the VS 2017 stores it in its own private registry hive. 我正在寻找一种方法来检索VS 2017的当前主题。旧版本的VS存储在Windows注册表中,但VS 2017将其存储在自己的私有注册表配置单元中。 Is there any way to get it in my VSIX extension? 有没有办法在我的VSIX扩展中获取它? Maybe there is a library function? 也许有图书馆功能?

Visual Studio 2017 maps private registry hive to regular registry keys when running. Visual Studio 2017在运行时将私有注册表配置单元映射到常规注册表项。 From your VSIX extension inside the VS 2017 process you can just read HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\15.0 and it will get you theme settings. 从VS 2017流程中的VSIX扩展,您只需阅读HKEY_CURRENT_USER \\ Software \\ Microsoft \\ VisualStudio \\ 15.0,它将为您提供主题设置。

You can find the CurrentSettings.vssettings file in this path. 您可以在此路径中找到CurrentSettings.vssettings文件。

C:\Users\xxx\AppData\Local\Microsoft\VisualStudio\15.0_3638b4c1\Settings

<Theme Id="{DE3DBBCD-F642-433C-8353-8F1DF4370ABA}"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM