Visual Studio 文本编辑器“成员”自动实现 C# 属性的下拉图标?

发布于 2024-08-23 01:00:08 字数 300 浏览 4 评论 0原文

有没有任何人知道的任何方法(可能通过加载项)可以轻松列出或可视化 Visual Studio 2008 SP1(独立或使用 ReSharper 4.5)中类的字段(和自动属性)?

我已经习惯于在 Visual Studio 2008 中 C# 代码文本编辑器的导航栏成员下拉列表中看到由蓝色框/菱形图标标识的类的字段。我发现了解类在字段中“拥有”什么状态以及类的实例的大约大小很有帮助。

自动实现的属性有一个匿名字段支持它们,但它们在成员下拉列表中没有单独的图标来指示它们背后有存储。

Is there any way (perhaps via add-in) that anyone knows to easily list or visualize the fields (and auto-properties) of a class in Visual Studio 2008 SP1 (standalone or with ReSharper 4.5)?

I have been used to seeing fields of a class identified by the blue box/diamond icon in the Members dropdown in the Navigation bar of C# code text editor in Visual Studio 2008. I find it helpful to tell what state the class "owns" in fields and approximately what size an instance of the class is.

Automatically implemented properties have an anonymous field backing them, but they don't have a separate icon in the members dropdown to indicate they have storage behind them.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

热风软妹 2024-08-30 01:00:08

我不知道在 Visual Studio 环境中进行这种区分的方法,但 ILDASM 实用程序(MSIL 反汇编器)确实向您显示了类中的所有字段,包括自动属性的支持字段。

您可以从 VS2008 命令行运行 ILDASM.exe,然后打开已编译的程序集。

这里有一个关于如何从 Visual Studio 中调用 ILDASM 的提示,但我自己还没有尝试过... http://www.devx.com/vb2themax/Tip/18784

同样,您可以从优秀的(而且免费!)Red Gate 的.Net Reflector。

I don't know a way of making this distinction within the Visual Studio environment, but the ILDASM utility (MSIL Disassembler) does show you all of the fields within a class, including backing fields for auto-properties.

You can run ILDASM.exe from the VS2008 command line, then open your compiled assembly.

There's a tip here for how to invoke ILDASM from within Visual Studio, but I haven't tried it myself... http://www.devx.com/vb2themax/Tip/18784

In a similar vein, you can get the same information from the excellent (and free!) .Net Reflector from Red Gate.

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