How to make Visual Studio look different depending on which solution is open?

I suspect that this is simply not possible, but that does not stop asking.

I am working on 2 branches of the same code, so that everything looks pretty accurate from the solution browser. But one is a branch, one is a chest. I have no visual clues as to which one is currently open.

In any case, so that Visual Studio 2010 displays some kind of visual hint that this project is different from another?

+4
source share
2 answers

If you don’t write some kind of plugin, no. I do the same thing often, what I usually do, or makes it a habit to double-check the path before I work on the file (hover over a tab in VS).

or , I have two monitors, and if I work simultaneously in two different branches, I will have one on the left and one on the right :-)

+1
source

I had the same problem a while ago, but I could not find anything to solve the problem. I was so upset that at the end I wrote a simple add-on for Visual Studio that showed the path to the current solution in the title bar of the window. This was not ideal, since you had to click on the tool window (e.g. Solution Explorer) to show it, but it worked for what I needed.

Code to add if you are interested:

public class Connect : IDTExtensibility2 { private DTE2 _applicationObject; private WindowEvents we; [DllImport("user32.dll")] private static extern bool SetWindowText(IntPtr hWnd, string lpString); public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom) { _applicationObject = (DTE2) application; we = _applicationObject.Events.get_WindowEvents(null); we.WindowActivated += WindowActivated; } private void WindowActivated(Window GotFocus, Window LostFocus) { string path = _applicationObject.Solution.FileName; if (!string.IsNullOrEmpty(path)) { SetWindowText((IntPtr) _applicationObject.MainWindow.HWnd, path); } } } 

It's a little rude, but they helped me a lot.

+1
source

Source: https://habr.com/ru/post/1336161/


All Articles