C# 我如何调用;“新建垂直选项卡组”;从VS2010加载项?

C# 我如何调用;“新建垂直选项卡组”;从VS2010加载项?,c#,visual-studio,visual-studio-2010,C#,Visual Studio,Visual Studio 2010,我正在构建VisualStudio2010附加模块。我想做的事情之一是调用文档的垂直拆分视图。我可以在VS GUI中通过选择Window->New Window然后选择Window->New Vertical Tab Group来实现这一点 如何从Visual Studio加载项调用相同的行为?您可以使用 你可以用 public void Exec(string commandName, vsCommandExecOption executeOption, ref object varIn, r

我正在构建VisualStudio2010附加模块。我想做的事情之一是调用文档的垂直拆分视图。我可以在VS GUI中通过选择
Window->New Window
然后选择
Window->New Vertical Tab Group
来实现这一点

如何从Visual Studio加载项调用相同的行为?

您可以使用

你可以用

public void Exec(string commandName, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
    {
        handled = false;
        if(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
        {
            if(commandName == "MyAddin1.Connect.MyAddin1")
            {
                //_applicationObject.ActiveWindow.WindowState.
                _applicationObject.ExecuteCommand("Window.NewWindow");
                _applicationObject.ExecuteCommand("Window.NewVerticalTabGroup");
                handled = true;
                return;
            }
        }
    }