C# organizing my code
Asked Answered
S

3

6

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 )

Stringboard answered 21/1, 2011 at 15:36 Comment(1)
Also see make-resharper-respect-your-preference-for-code-order?Bespeak
M
6

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/

Microscopium answered 21/1, 2011 at 15:41 Comment(1)
Thank's for that amazing post!Stringboard
B
3

Yes, resharper has such a feature (and many other equally marvelous ones).

Bernal answered 21/1, 2011 at 15:38 Comment(0)
J
3

Telerik's JustCode has this feature as well. Code ordering rules are easily customizable through the Options dialog - No XML. JustCode - Reordering

Jocelynjocelyne answered 21/1, 2011 at 15:47 Comment(1)
Nice! I'll try it, but I trust resharper a little bit more)Stringboard

© 2022 - 2024 — McMap. All rights reserved.