New CodePlex project: PowerCommands for Reflector (most recent version is 1.0.1.28698)
Recently I’ve noticed that I get quite a bit of traffic to my site for Reflector add-ins. This shouldn’t be a problem since I have a page just for that (http://jasonhaley.com/addins/) … except I haven’t kept it updated with all of my add-ins. For the ones not on that page you have to find them in my blog … not very user friendly eh?
This week I got inspired by the PowerCommands for Visual Studio project to take the majority of my add-ins and consolidate them. In the process of consolidating them, I realized that code base I built to move the functionality to a command pattern (modeled after the PowerCommands for Visual Studio) will now make it easier for me to build new commands … in fact I built 5 new ones pretty easily and released them with the v1 of PowerCommands for Reflector.
Now all of my Reflector add-ins except for Reflector.Snippy and Reflector.Babel (and a couple of other small ones) are in the PowerCommands for Reflector project. Which means if you have my old add-ins installed – you can remove them and just add the Reflector.PowerCommands addin.
Here is a breakdown of the commands included in v1 and the add-ins they use to belong to:
Command from the AssemblyCollection.Sort Addin
Reorder Assemblies
This command is useful when you have added several assemblies to your assembly list ... then have problems locating a specific assembly due to the names not being alphabetical. This command will alphabetize the assembly list for you and is available on the Tools menu and the assembly level context menu (the highest level parents in the assembly tree)
Commands from the Enums Addin
Bit Flag Converter
This is a utility that allows you to calculate bit flags (enumerations with the flags attribute). You can either check the enumeration items to get the integer representation of the value or you can type an interger into the Bit Mask text boxt and tab out to find out what enumeration items are included in that integer. This command is only available on the context menu for enumerations with the flags attribute. For example, the System.Data.CommandBehavior is an enumeration with the flags attribute. If you right click on the "CommandBehavior" in the assembly list, you will see the "Bit Flag Converter" item towards the bottom of that context menu.
Enum Viewer
This is a utility that allows you to configure via the option pages (View menu-> Options -> Enums) how an enumeration is written out. The setting options allow you to force the value to be shown, change the ordering of the items (alpha by or value) and change the number format between decimal and hex. This command is only available on the context menu for enumerations. For example, the System.Data.CommandBehavior is an enumeration. If you right click on the "CommandBehavior" in the assembly list, you will see the "Enum Viewer" item towards the bottom of that context menu.
Commands from the CodeShortcut Addin
Create Shortcut
The Create Shortcut command will create a shortcut on your desktop which will have the code protocol path to the item you created the shortcut for ... in short that means if you create a shortcut with this command, you will be able to double click on the shortcut (on your desktop) to then have Reflector open and go directly to that item. This command is available on most context menus of the nodes in the assembly tree, just right click and choose the "Create Shortcut" context menu item.
Commands from the OpenZip Addin
Open Zip 
Ever download an assembly that was zipped ... then have to unzip it and move that unzipped file and then add it to Reflector? The Open Zip command helps with this situation by provideing the ability to open a zip file containing assemblies and then easily extracting them to then add to the assembly list. This command is availabe on the File menu -> Open Zip.
Commands from the Assembly List Import/Export Addin
Assembly List Import/Export
This command allows you to import and export Reflector assembly lists. This helps when you customize the assembly lists the way you want them ... then need them on another machine. This command is available on the Tools menu.
Commands from the CopyPath and VS Command Prompt Here Addin
Copy Path
This command provides a submenu containing the path to the assembly file or the directory of the assembly. Once you click on one of the submenu items, the chosen path will be copied to the clipboard. This command is available on the context menu at the module level (the level where the file name is listed - an example would be the node containing "System.Data.dll").
Open VS2005/VS2008/VS2010[New] Command Prompt
These commands open a command prompt with the environment set for the respective Visual Studio version and the path set to the directory of the currently chosen assembly. These commands are available on the module level of the assembly tree (the level with the file names: ie. System.Data.dll). By default the VS2008 is enabled, you can turn the VS2005 and VS2010 by checking them in the options page (View menu -> Options -> Power Commands).
Open Windows Explorer
This command opens Windows Explorer pointing to the directory of the currently chosen assembly. This command is available on the module level of the assembly tree (the level with the file name: ie. System.Data.dll).
New Commands not released in a previous addin
Collapse All
The Collapse All command exposes the underlying tree view's CollapseAll method functionality - which means it will collapse all expanded nodes that are currently open. This command is available on the Tools menu and on the context menu at the Assembly level (highest level parents).
Save as RESX
The Save as RESX command is only available for embedded resources which are .resources files. This command will read all the resources out of the compiled file and create a .resx file containing all of those resources. This command is available on the context menu of the individual resources.
Create Assembly Binding Redirect
Ever have to create a config file entry containing an assembly binding for a binding redirect? This command helps speed the generation of that xml for you. All you need to do is provide the old version numbers and the new version numbers and the xml will be created and copied to the clipboard. This command is available at the assembly level context menu (the highest level parents in the assembly tree). The context menu item is towards the bottom with the name of "Create Binding Redirect"
Email Code
Inspired by the VS PowerCommands' "Email Code Snippet", this command will open your default email program's new message (it uses the mailto protocol to do this) and put the disassembled text of the chosen item into the body of the email. This command is only avaiable for individual properties, methods, fields and events and due to length restrictions doesn't work on long code bodies. The image for this command was created by Lutz Roeder (BTW: all other credits are outlined in the About box reachable from the the Power Commands option page).
I’m always taking request for Reflector Add-in functionality … do you have any requests?