Search code examples
c#visual-studio-2010resharpercode-formattingcode-organization

C# organizing my code


does any tool (VS extension, or maybe Resharper supports this...) exist which can orginize code in my class in some specified way? Like this :

public static fields/properties
private static fields/properties

public fields/properties
private fields/properties

constructors

public static methods
private static methods

public methods
private methods

etc

(and all are sorted alphabetically)

It would be so nice...

I like to have my code very organized, but sometimes I do not follow my own rules and than reorganizing everything by hands may be a little bit problematic )


Solution

  • Yes, ReSharper can do it. You can even customize the way it organizes items... take a look at this blog post by Hadi Hariri http://hadihariri.com/2011/01/04/in-depth-look-at-customizing-type-layout-with-resharper/