views:

78

answers:

3

i want all of the system usings at the top (sorted alphabetically) and then all other using statements afterwards (sorted alphabetically)

+1  A: 

Don't know about RefactorPro, but since the question is tagged with "visual-studio-2008", you can do it in VS'08 by going to Tools -> Options -> Text Editor -> C# (or whatever is relevant) -> Advanced and then ticking "Place 'System' directives first when sorting usings".

Max Shawabkeh
+1 - VS does this already, who needs a refactor tool?
slugster
advantage of the refactor tool is that it becomes a part of the same refactoring shortcut that you use for everything else.... yeah you can make that shortcut the same but it'll be nice if it is all in one place...
Jon Erickson
+1  A: 

RefactorPro / CodeRush both have refactorings to....

  • Optimize namespaces (remove unused namespaces)
  • Sort Alphabetically
  • Sort by length

Additionally there are (3rd party) plugins that sort in many other ways.

For example: Refactor_SortNamespacesByScope

Additionally, although the asker does not require this, these products also work VS2005.

Rory Becker
+4  A: 

You can make Refactor Pro to do it your way. Open "DevExpress -> Options -> Editor -> Refactoring -> Optimize Namespace References" and set relevant options according to your preferences.

Optimize Namespace References

Przemaas
exactly what I was looking for!
Jon Erickson