在 .NET 中显示类层次结构的工具
有没有一种方法/工具可以向我显示项目中实现某个接口的所有类/接口? 在 Eclipse (Java) 中,我将使用上下文菜单“打开类型层次结构”选项,该选项将显示扩展所选类型的(漂亮的)类型树。 .NET 中是否有工具可以执行相同的操作?
Is there a way/tool that could show me all the classes/interfaces that implement a certain interface in my project? In Eclipse (Java) I would use the context menu "Open Type Hierarchy" option, which would show me a (pretty) tree of types that extend the selected type. Is there a tool to do the same in .NET?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
我赞同 Marc 对 .NET Reflector 的推荐 - 并且想补充一点,有一个CodePlex 提供了一系列令人印象深刻的插件。
我经常使用的几个插件是:
I second Marc's recommendation of .NET Reflector - and would like to add that there is an impressive series of add-in available at CodePlex.
Just a few of the add-ins I use with regularity:
Resharper Visual Studio 插件还具有视图类型层次结构功能以及许多其他出色的功能。
The Resharper visual studio plugin also has a View Type Hierarchy feature along with its many other great features.
您可以使用对象浏览器视觉工作室:
You can use the Object Browser inside Visual Studio:
Reflector 可以做到这一点(并且是免费的)。 找到该接口,然后展开树中的“派生类型”节点。
或者,Visual Studio 中的“类图”项目项应该可以完成此操作,但我喜欢 Reflector 的简洁特性。
Reflector will do this (and is free). Find the interface, and expand the "Derived Types" node in the tree.
Alternatively, the "Class Diagram" project item in Visual Studio should do it, but I like the clean nature of Reflector.
我发现这个 Resharper 函数可以方便地仅显示类型层次结构。 类似于 eclipse 提供的东西(F4 - 打开类型层次结构)
选择父类,然后右键单击 VS 编辑器并选择“高级查找用法”并选择“派生类型”复选框(或)按 CTRL + ALT + SHIFT F12 显示搜索属性窗口
I found this Resharper function handy to show only type hierarchy. Something close to what eclipse offers (F4 - Open type hierarchy)
Select parent class then Right click on VS editor and select 'find usages advanced' and select 'derived types' checkbox (or) hit CTRL + ALT + SHIFT F12 to show search properties window
我刚刚发现查看派生类的选项在 C++ 中可用(在类视图中),但在 Visual Studio 2008 中的 C# 中不可用。哇。
I've just discovered that the option to see derived classes is available in C++ (in Class View), but not in C# in Visual Studio 2008. Wow.
由于我在 2018 年一直在寻找相同的内容:
从 Visual Studio 2015 开始,您只需安装 Type来自市场的层次结构查看器。 这确实不像 Eclipse 版本那么漂亮,但效果很好,而且是免费的。
Since I was looking for the same in 2018:
Starting from Visual Studio 2015 you can simply install Type Hierarchy Viewer from the Marketplace. This truly isn't as pretty as its eclipse counterpart, but does the job well and is free.