I use File: Option-3 and a mix of "Within class: Option-1" + "Within class: Option-2" depends on the class type. If there is clear relationship then I'll go for option-2 but most of the time I stick with Option-1.
I only have a single element
per file. If you need to group things together to tidy them up, then that is what namespaces are for.
I also tend to stick fields and properties at the top of classes, followed by the constructors, then methods. I usually keep private methods next to the public ones that use them.
Edit: And under no circumstances should you use regions! ever. at all. If youre class is so big you need to collapse huge portions of it youve got far worse problems to worry about.
I usually use Option-3 for files and Option-1 within classes. Classes are structured by this regions:
- Nested Classes
- Constants
- Events / Delegates
- Fields
- Construction / Destruction / Finalization
- Properties
- Methods
I generally put types in their seperate files. (Enums, structs, classes and delegates) Nested types go in the same file as their parenting type. Partial files are only used with generated files.
Within a file, the main structure is:
- Nested classes
- Consts, fields, event and delegate fields
- Properties
- Ctors
- Finalizer
- Methods (related ones are close to eachother, not necessarily grouped by accessibillity.)
I'm not too strict on these rules. They're guidelines...