views:

466

answers:

2

Hi,

I like to put my using directives inside the current namespace, and not outside as VS and Resharper per default puts them.

Does anyone know of a macro/standard functionality that sorts/removes unused using directives and puts them inside the current namespace?

--larsw

A: 

I've edited my default visual studio templates to put my using directives inside the namespace.

For sorting and removing unused directives, I use Power Commands for Visual Studio 2008.

Aaron Daniels
+11  A: 

Have you tried the Resharper option:

Languages -> C# -> Formatting Style -> Namespace Imports -> Add using directive to the deepest scope

I'm not sure whether R#'s code cleanup will reorder the existing ones for you though.

marklam
That did the trick - thanks a bunch! :-) --larsw
larsw