Enum Addin and the new Addins Section

by Jason Haley 16. September 2007 13:38

I've added a couple of things to the Enum addin since I wrote the Ways to use .Net Reflector #2.1: Creating your own add-ins as well as fixed a few bugs.  I'm working on an entry that will go into detail on the changes, but today I added the Addins section to my site with the latest code and I thought I should at least mention the new stuff.

The Bit Flag Converter is still there and functions the same, but now has a short cut key of Ctrl+Shift+F.

The main change is the addition of the Enum Viewer (short cut key Ctrl+Shift+V).  

imageThe Enum Viewer has a property page, which you can access through View->Options and choose Enums in the listing, that allows the user set three things for viewing enums:

- Forcing the values to always be output

- Have the enum fields ordered by whatever Reflector feels like (Auto), Alphabetical or by value of the field

- Change the numeric format to Decimal or Hexidecimal

All these settings will be saved in the Reflector.cfg file if you decide to customize the settings.

The Enum Viewer was written to provide a customized disassembly of enum types.  The viewer code is mostly from Lutz's ClassView addin and some of the custom enum language writing was modeled from Jason Shirk and Dean Wills's C++ lanaguage addin.  I've only created custom enum writers for C# and VB.  If you try to view an enum in another language you will get the C# disassembly of the enum.  I have left the format of the viewer (font, colors, etc.) just as Lutz originally had in the ClassView addin - I figured it would help the enum viewer stick out so I wouldn't confuse it with the disassembler view. Below is an example of what Reflector shows in its Disassembler view vs. the Enum Viewer.  

image image

NOTE: If you go to View->Options and choose Disassembler in the list, you can change the Number Format to Decimal which will then show all decimal numbers instead of a mix.

The downloads are currently located on my site, but I may move things to the codeplex site in the future.  You can get the source here or just the dll here

If all goes well, I should have the detailed article that describes creating your own property pages, interacting with the cfg file and writing language writers completed sometime this month ... but until then - you can go ahead an use the code and check it out.

 

 

 

BTW: I also added a short cut key to the AssemblyCollection.Sort that is posted on the Addins Section, which I've found to be quite useful.

Comments (0) | Post RSSRSS comment feed |

Categories:
Tags:

Comments are closed