visual-studio 显示方法列表的 Visual Studio 窗口
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2819519/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio window which shows list of methods
提问by Hyman Kada
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.
在 Visual Studio 中,是否有一个窗口显示活动类中的方法列表?像解决方案资源管理器这样的小窗口会很棒。在 Eclipse 中,有一个。
回答by ChrisF
There's a drop down just above the code window:
代码窗口上方有一个下拉菜单:


It's called Navigation barand contains three drop downs: first drop down contains project, second typeand third members(methods).
它称为导航栏,包含三个下拉列表:第一个下拉列表包含项目、第二个类型和第三个成员(方法)。
You can use the shortcut Ctrl+ F2(move focus to the projectdrop down) and press Tabtwice (move focus to the third drop down) to focus it, down arrow will expand the list.
您可以使用快捷键Ctrl+ F2(将焦点移至项目下拉列表)并按Tab两次(将焦点移至第三个下拉列表)以将其聚焦,向下箭头将展开列表。
回答by mark.oliver.asp.newbie
I found how to turn the drop down on as shown in the first answer (@ChrisF):
我找到了如何打开下拉菜单,如第一个答案 (@ChrisF) 所示:
Go to Options->Text Editor->(your language)
转到选项->文本编辑器->(您的语言)
and tick "Navigation bar" in the display section.
并在显示部分勾选“导航栏”。
回答by mLar
Since Visual Studio 2012, you can view the outline ( fields and methods) in the solution explorer by expanding the node corresponding to your file .
从 Visual Studio 2012 开始,您可以通过展开与您的文件对应的节点来查看解决方案资源管理器中的大纲(字段和方法)。
回答by kejster
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.
导航栏的快捷方式是Ctrl+ F2。首先带您进入类型下拉列表。按 Tab 键转到方法下拉列表,然后输入一种方法转到该方法。
回答by sqeez3r
ReSharper has a 'ReSharper | Windows | File Structure' window, which is used for visualizing current code file structure.
ReSharper 有一个“ReSharper | 窗户| File Structure' 窗口,用于可视化当前代码文件结构。
回答by Philip Pittle
Resharper has the File Structure window which is very similar to eclipse outline view. Originally answered in:
Resharper 具有文件结构窗口,它与 eclipse 大纲视图非常相似。原回答于:
Visual Studio 2012: List of all Methods in class
Resharper help: http://www.jetbrains.com/resharper/webhelp/Reference__Windows__File_Structure_Window.html
Resharper 帮助:http: //www.jetbrains.com/resharper/webhelp/Reference__Windows__File_Structure_Window.html


回答by Mo Hrad A
Despite it's an old question maybe this answer help you as helped me.
尽管这是一个老问题,但也许这个答案对你有帮助,也对我有帮助。
you can download codemaid extension from here : codemaid website
您可以从这里下载 codemaid 扩展:codemaid 网站
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.
从树视图层次结构中可视化和浏览 C# 和 C++ 文件的内容。在不同的排序方法之间快速切换以获得更好的概览。拖放以重新组织代码。请参阅 McCabe 复杂性分数和信息性工具提示。
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
换句话说,它使您能够查看方法和属性,并且只需通过拖放即可重新组织它们。这是我的日常使用扩展
回答by Ben Hoffstein
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.
没有与 Eclipse 中的大纲视图直接等效的东西。我发现的最接近的是类视图,它列出了所有类及其成员/方法。顶部有一个搜索框可以缩小选择范围。
回答by Sridhar Jammalamadaka
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.
在 Visual Studio 2015 中,查看 > 其他窗口 > 资源视图。键盘快捷键是Ctrl+ Shift+ E。我觉得这比类视图更干净。使用类视图窗口,您可以根据访问修饰符(私有/受保护/公共)等过滤方法/属性。
回答by Andras Zoltan
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...
另外,如果你使用类浏览器(Ctrl+ Alt+ C)来浏览你的项目,那么你会得到所有类型的完整的概述。但是,工具/选项中似乎没有设置允许您跟踪该窗口中的活动类型(解决方案资源管理器中有) - 也许宏或插件是有序的......

