Visual Studio window manager

假装没事ソ 提交于 2019-11-29 02:41:20
Brian Schmitt

You can check out my blog post, Save and Change Tool Layout in Visual Studio, which provides the ability to list and switch window layouts.

Your question was answered on the very same page where you asked it :-)

Just for the record:

To get this to work for 2008, add a new HostApplication element to the WindowManager2005.AddIn file. The file is typically found in "%APPDATA%\Microsoft\MSEnvShared\Addins". Change the version in the new element to be 9.0 (VS 2008) and it should work in both 2008 and 2005.

<HostApplication>
  <Name>Microsoft Visual Studio</Name>
  <Version>9.0</Version>
</HostApplication>
sontek

You should contact RW on CodePlex. He claims to have it working in Visual Studio 2008. Check out this item.

pettys

The following macros may do the trick for you. I did your WindowManager mentioned above, recompiling it to work for Visual Studio 2008, but I still found it a little flaky. Also, I don't use the "Auto Apply Layouts" functionality in WindowManager, so these macros work great for me for switching from dual-monitor working to laptop-only working.

Sub DualMonitorConfiguration_Save()
    SaveWindowConfiguration("Dual Monitor Layout")
End Sub

Sub DualMonitorConfiguration_Load()
    LoadWindowConfiguration("Dual Monitor Layout")
End Sub

Sub LaptopOnlyConfiguration_Save()
    SaveWindowConfiguration("Laptop Only Layout")
End Sub

Sub LaptopOnlyConfiguration_Load()
    LoadWindowConfiguration("Laptop Only Layout")
End Sub

Private Sub SaveWindowConfiguration(ByVal configName As String)
    Dim selectedConfig As WindowConfiguration
    selectedConfig = FindWindowConfiguration(configName)
    If selectedConfig Is Nothing Then
        selectedConfig = DTE.WindowConfigurations.Add(configName)
    End If

    selectedConfig.Update()
    DTE.StatusBar.Text = "Window configuration saved: " & configName
End Sub

Sub LoadWindowConfiguration(ByVal configName As String)
    Dim selectedConfig As WindowConfiguration
    selectedConfig = FindWindowConfiguration(configName)
    If selectedConfig Is Nothing Then
        MsgBox("Window Configuration """ & configName & """ not found.")
    Else
        selectedConfig.Apply()
        DTE.StatusBar.Text = "Window configuration applied: " & configName
    End If
End Sub

Private Function FindWindowConfiguration(ByVal name As String) As WindowConfiguration
    Dim selectedLayout As WindowConfiguration

    For Each config As WindowConfiguration In DTE.WindowConfigurations
        If config.Name = name Then
            Return config
        End If
    Next

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