How to view an active view C# class in 'Solution Explorer'?
I have a solution which has many projects inside it. I build the solution and have some compile errors. Double clicking an error will open a class file, called FileA.cs. What I don't know how to do is viewing FileA.cs in the Solution E开发者_开发问答xplorer pane.
You have 2 options without macros, either always enable tracking, or bind a key to toggle it:
If you want to always enable tracking: Enable the Track Active Item in Solution Explorer option, but note there's some performance penalty is leaving this on. Get to this by Tools > Options > Projects and Solutions > General
Alternatively, bind a key to turn this on and off (but you'll have to hit it twice).
Third, macro option, make this macro and bind to a key so you don't have to hit it twice to disable it:
Sub FindInSolutionExplorer()
DTE.ExecuteCommand ("View.TrackActivityinSolutionExplorer")
DTE.ExecuteCommand ("View.TrackActivityinSolutionExplorer")
End Sub
精彩评论