How to programmatically open Visual Studio Tools->Options dialog on a specific page?

和自甴很熟 提交于 2019-12-20 05:14:36

问题


I am writing a Visual Studio extension and I need to programmatically open the Tools->Options dialog on a specific page.

I could find how to open the dialog on the default page:

var editor = (my_package as System.IServiceProvider).GetService(typeof(DTE)) as DTE2;
editor.ExecuteCommand("Tools.Options");

I have found that I can pass some parameter after the command name. But passing the specific page name I want does not seem to do the trick.

  • Is it even possible to open a specific page?
  • Is there some specific grammar to give the expected page name?
  • Is there some better practice to do that instead of using editor.ExecuteCommand?

回答1:


Following Lance's answer, for me it gives:

myVSPackage.ShowOptionPage(typeof(myOptionPage));


来源:https://stackoverflow.com/questions/56767368/how-to-programmatically-open-visual-studio-tools-options-dialog-on-a-specific-p

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!