Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio - Automatically refresh class view when changing class

After reading kingmaxxx's reply, I went to Tools->Options->Environment->Keyboard and bound Ctrl+Shift+C to View.SynchronizeClassView in Text Editor view. This seems to supplant and supplement the original behavior (View.ClassView), as it will display ClassView if it wasn't visible and focus on the current class.

(Visual Studio 2008)


For Visual Studio 2005

I found a solution that does not update the view automatically, but at least you get a context entry that helps:

http://blogs.msdn.com/ansonh/archive/2005/12/09/502020.aspx

You can also define a shortcut key:

Tools->Options->Environment->Keyboard and see if you can find "View.SynchronizeClassView".


Oh, just for laughs - here is the answer of Microsoft: http://msdn.microsoft.com/en-us/library/2dae8h2s.aspx

...you can select any symbol in the Code Editor and locate it instantly...

After 7 Steps...

"Class View automatically scrolls to the location of the selected symbol in its hierarchy. "


The best way is to create a context menu when you right-click on a type in code editor. Tools->Customize Click on 'Commands' tab. Select Context Menu radio button, and select "Editor Context Menus | Code Window". Then "Add Command" and select View->Synchronize Class View.

Now whenever you right-click on a type, you can select "Synchronize Class View". It's the very top context-menu item. Looks like this: Context-menu


I can't help you with the class view, but maybe you want to give the solution explorer a try? You can synchronize this one via:

tools -> options -> projects and solutions -> general
enable "track active item in solution explorer"

The problem with View.SynchronizeClassView is that is doesn't work when a class is being viewed from a virtual folder.