Visual Studio - Automatically refresh class view w

2019-01-31 06:32发布

I come from a Java background and have spent many years using Eclipse. One feature that I miss when using Visual Studio (2008) is that the class view does not automatically refresh when I change class. In Eclipse it has a (class) 'Outline' window which represents the current class and shows methods/properties etc, this always updates to the class one is using.

The equivalent 'Class View' in VS does not automatically refresh according to the current class I am visiting. I wondered if anyone knew a way to make this happen?

Ideally I'd like the VS view to be as similar to Eclipse as I could get it, but this one feature would be great.

Thanks in advance, Will

13条回答
太酷不给撩
2楼-- · 2019-01-31 06:33

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)

查看更多
何必那么认真
3楼-- · 2019-01-31 06:40

For Visual Studio 2017, CodeMaid Spade comes to the rescue quite perfectly.

https://marketplace.visualstudio.com/items?itemName=SteveCadwallader.CodeMaid

At first, I couldn't find the equivalent to 'Class View'. It's called Spade.

It auto-syncs to the currently open class.

查看更多
贼婆χ
4楼-- · 2019-01-31 06:42

Coming from Eclipse you will miss a lot of such features. What I miss most for navigation is an easy go to type, go to inheritor and so forth. Other features, such as nUnit support are not part of the vanilla Visual Studio, too. Here is a list of Add-Ins that bridge the gap:

But here comes the drawback: They all charge you money (TestDriven.net only for commercial use). However, they all offer free trials.

查看更多
【Aperson】
5楼-- · 2019-01-31 06:44

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. "

查看更多
Root(大扎)
6楼-- · 2019-01-31 06:46

Tools Menu -> Options

Then, in the "Project And Solutions" area, you can select to track the active item.

查看更多
不美不萌又怎样
7楼-- · 2019-01-31 06:47

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

查看更多
登录 后发表回答