Visual Studio 文本编辑器“成员”自动实现 C# 属性的下拉图标?
有没有任何人知道的任何方法(可能通过加载项)可以轻松列出或可视化 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道在 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.