views:

571

answers:

3

I'm doing some class clean to organize the functions in cs file in alphabetical order. I'm using Visual Studio 2008.

When writing them, I just put them arbitrarily, but it now looks quite messy.

Is there some easy way to organize them automatically?

Better to have a tool because there're quite a lot files to clean up.

+3  A: 

Have you tried Regionerate?

Dmitri Nesteruk
+1. As Dmitri say, you don't really need to cleanup in this way, the most easy way is to implement regions,and Regionarate tools make it automaticly.
Avram
+11  A: 

Why bother organizing in alpha order? The IDE provides a drop down list in order for you to use if you wish to access them in that manner.

Instead the source file should contain them in a meaningful order (what is meaningful is rather subjective) either by the specifics of their tasks or by some sensible convention if nothing else exists (such as by visibility, or placing properties together).

Auto layout rules are a nightmare for source repositories since they put in needless mass movements that frustrate your ability to identify real change, as such they should be avoided unless the rules comply with one of the following:

  • They never change and you can apply it from the beginning of your project
  • They change very rarely and changing will affect at most a single line movement (like bracketing structure)
  • They change rarely and the effect is simply on white space within a line

If the answer is at all beyond 'rarely' you don't want to use it full stop, efficient browsing of historical changes is more useful.

ShuggyCoUk
A: 

In Regionerate:

  1. Open the schemas from: C:\Program Files\Regionerate
  2. Select cluster by name
  3. Select remove regions

Your methods, fields, etc. code will be ordered alphabetically.