In Visual Studio, is there a window which shows list of methods in the active class? A small window like the Solution Explorer would be great. In Eclipse, there is one.
问题:
回答1:
There's a drop down just above the code window:
It's called Navigation bar and contains three drop downs: first drop down contains project, second type and third members (methods).
You can use the shortcut Ctrl + F2 (move focus to the project drop down) and press Tab twice (move focus to the third drop down) to focus it, down arrow will expand the list.
Full size image
回答2:
I found how to turn the drop down on as shown in the first answer (@ChrisF):
Go to Options->Text Editor->(your language)
and tick "Navigation bar" in the display section.
回答3:
Shortcut to Navigation Bar is Ctrl+F2. Takes you to the types dropdown first. Press tab to go to method dropdown, and then enter on a method to go to that one.
回答4:
Since Visual Studio 2012, you can view the outline ( fields and methods) in the solution explorer by expanding the node corresponding to your file .
回答5:
ReSharper has a 'ReSharper | Windows | File Structure' window, which is used for visualizing current code file structure.
回答6:
Resharper has the File Structure window which is very similar to eclipse outline view. Originally answered in:
Visual Studio 2012: List of all Methods in class
Resharper help: http://www.jetbrains.com/resharper/webhelp/Reference__Windows__File_Structure_Window.html
回答7:
Despite it's an old question maybe this answer help you as helped me.
you can download codemaid extension from here : codemaid website
it has a lot of functionality that you may find in their website.
the one that is related to this question is code digging
Visualize and navigate through the contents of your C# and C++ files from a tree view hierarchy. Quickly switch between different sorting methods to get a better overview. Drag and drop to reorganize the code. See McCabe complexity scores and informative tool tips.
in other words it give you ability to see the methods and properties and also reorganize them just with drag and drop. it's my everyday use extension
回答8:
There is no direct equivalent to the Outline View in Eclipse. The closest thing I've found is the Class View, which lists all classes and their members/methods. There is a search box at the top to narrow the selection.
回答9:
At the top of your text editor, you should have a dropdown that lists all the methods, properties etc in the current type; and it's clickable (even if those members are defined in other files - in which case they're greyed out but you can still navigate with them).
Also, if you use the Class Explorer (Ctrl+Alt+C) to navigate your project, then you'll get a full overview of all your types. However, there doesn't appear to be a setting in Tools/Options that allows you to track the active type in that window (there is for the solution explorer) - perhaps a macro or addin is in order...
回答10:
In Visual Studio 2015, View > Other Windows > Resource View. The keyboard shortcut is Ctrl+Shift+E. I find this cleaner than Class View. With Class View Windows you can filter methods/attributes based on access modifier (private/protected/public) etc.
回答11:
In Visual Studio 2005 and 2008 you can try the Source Code Outliner Power Toy.
alt text http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=SourceCodeOutliner&DownloadId=3493
回答12:
Do you mean the class view window (View->Class View, or Ctrl+W,C)?
You also have the intellisence popup-window
回答13:
With Visual Studio 2010
You choose Tools->Settings->Expert Settings
On the left-bottom corner, you will see the tab "Class View" right next tab "Solution Explorer"
In the top area of "Class View" layout, you will see the list of class name, enum, struct, ... In the bottom area of "Class View layout, you will see the list of member for these class, enum or struct
回答14:
Microsoft doesn't feel like implementing this useful tool, but if by chance you can have Visual Assist, you have it in VAssistX > Tools > VA Outline. The plugin is not free though.
回答15:
I have been using USysWare DPack since forever. It is very small and not intrusive so if all you want is a quick shortcut window showing list of methods of the current file you are using, it provides just that. Good thing is that the author is still active after more than 10 years just to keep providing the same features into latest VS release.
https://marketplace.visualstudio.com/items?itemName=SergeyM.DPack-16348
After installation, just use Alt + M
to bring up the method list window. I prefer to show all members instead, but it's up to you.
回答16:
A nice clean way to do this is to use View.SynchronizeClassView.
Additionally you can:
- pin your Class view window
- collapse the top pane (listing all the classes)
And now it feels just like the Visual Assist's feature "List Methods in Current File" (which also list members btw).
回答17:
In VS 2012, just go to View > Class View...then you get the Class View GUI in the main tab area. Now, drag this over to the side dock and you have the exact same layout as you would in Eclipse.
-e
回答18:
My best way to do this is, that i open the Code Definition Window, under View -> Code Definition Window or press Ctrl + W,D .
And then i got it floated and i have the definitions of methods in separate windows.
Regards
回答19:
grep -i " sub " filename.vb > methods.txt grep -i " function " filename.vb >> methods.txt