在 .NET 中显示类层次结构的工具

发布于 2024-07-11 10:52:12 字数 128 浏览 6 评论 0原文

有没有一种方法/工具可以向我显示项目中实现某个接口的所有类/接口? 在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

想你只要分分秒秒 2024-07-18 10:52:12

我赞同 Marc 对 .NET Reflector 的推荐 - 并且想补充一点,有一个CodePlex 提供了一系列令人印象深刻的插件。

我经常使用的几个插件是:

  • Deblector - 该插件允许从 Reflector 内调试进程。
  • 图表 - 此插件绘制程序集依赖关系图和 IL 图表。
  • DependencyStructureMatrix - 允许您创建和浏览依赖结构矩阵。
  • AutoDiagrammer - 该插件绘制类图。
  • CodeModelViewer - 此加载项显示所选项目的基础代码模型对象。

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:

  • Deblector - This add-in allows to debug processes from within Reflector.
  • Graph - This add-in draws assembly dependency graphs and IL graphs.
  • DependencyStructureMatrix - Allows you to create and browse dependency structure matrices.
  • AutoDiagrammer - This add-in draws class diagrams.
  • CodeModelViewer - This add-in shows the underlying code model objects for selected items.
冰之心 2024-07-18 10:52:12

Resharper Visual Studio 插件还具有视图类型层次结构功能以及许多其他出色的功能。

The Resharper visual studio plugin also has a View Type Hierarchy feature along with its many other great features.

够钟 2024-07-18 10:52:12

您可以使用对象浏览器视觉工作室:

对象浏览器允许您选择和检查可在项目中使用的符号。 您可以从“视图”菜单打开“对象浏览器”,或者单击主工具栏上的“对象浏览器”按钮。

在“对象”窗格中,图标标识层次结构,例如 .NET Framework 和 COM 组件、命名空间、类型库、接口、枚举和类。 您可以展开这些结构以显示其成员的有序列表。 属性、方法、事件、变量、常量和其他包含的项目都列在“成员”窗格中。 在“对象”窗格或“成员”窗格中选择的项目的详细信息将显示在“描述”窗格中。

You can use the Object Browser inside Visual Studio:

The Object Browser lets you select and examine the symbols available for use in projects. You can open the Object Browser from the View menu, or by clicking the Object Browser button on the main toolbar.

In the Objects pane, icons identify hierarchical structures such as .NET Framework and COM components, namespaces, type libraries, interfaces, enums, and classes. You can expand these structures to reveal ordered lists of their members. Properties, methods, events, variables, constants, and other contained items are listed in the Members pane. Details on the item selected in the Objects pane or Members pane appear in the Description pane.

夢归不見 2024-07-18 10:52:12

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.

怎樣才叫好 2024-07-18 10:52:12

我发现这个 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

enter image description here

那些过往 2024-07-18 10:52:12

我刚刚发现查看派生类的选项在 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.

抚你发端 2024-07-18 10:52:12

由于我在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文