开发者

Visual studio text editor "members" dropdown icons for auto implemented C# properties?

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 20开发者_如何转开发08. 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜