Visual Studio window manager

爷,独闯天下 提交于 2019-11-27 17:00:23

问题


Is there a window manager for Visual Studio 2008 like this one. I really liked it, and that's all I used in Visual Studio 2005 and saw somewhere it is supposed to work in Visual Studio 2008, but it doesn't. I have tried it on many installations of Visual Studio 2008, and it doesn't remember any settings. I really liked being able to easily change window layout quickly. Right now I just manually import and export settings, but it's not an instant process.

What do I have to do to make it work?


回答1:


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.




回答2:


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>



回答3:


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




回答4:


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


来源:https://stackoverflow.com/questions/123105/visual-studio-window-manager

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