问题
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