Resource Refactoring Tool
Posted by Marcus Wyatt on 10 November 2006
What a cool utility as part of the Power Toys for Visual Studio. The Resource Refactoring Tool provides you a way to extract hard coded strings from your code to a new or existing resource files. It is a aplha release, but I’ve used it now for about a day and it is stable.
How does the tool work?
The first thing I have done is to give it a keyboard shortcut. I don’t use the standard refactoring tools, so I have re-assigned the Ctrl+R, Ctrl+R keyboard shortcut to the “Extract to Resource” item. The command your looking for in the keyboard scheme is “Microsoft.VSPowerToys.ResourceRefactor.Connect.RefactorLiteral”.
Now you just select some hard coded text and hit your shortcut. You should see the following dialog box.
What you can do now is select if you want to create a new resource file or use an existing resource file. The screenshot shows an existing resource file. It also tells you if the Resource name you want to assign is already in use. I also like how it shows what the code will look like after the refactoring. I am a big Resharper fanatic, but this is one of the better Microsoft refactoring offerings. Good job MS…
tags: vs2005, refactoring, visualstudio, tools
Currently listening to: Zee – Dreamtime (Vocal MIx)