- PascalCase for all class names, method names, and property names.
- _camelCase for private fields.
- camelCase for local variables and method arguments.
Names should be detailed and descriptive. Avoid abbreviations and acronyms.
Classes should be generally organized in the following order:
- Constructors
- Private fields and properties
- Public properties
- Public events
- Public methods
- Private methods
- Interface methods
- Destructor
- Internal types (enums, structs, etc.)
#region directives should be used for classes and structs exceeding 100 lines of code.
More specific #regions can be created for related fields/properties/methods.
- Properties and fields should have inline comments explaining their purpose.
Groups of related fields or properties with a common purpose can have a single comment above the group.
Properties with complex behavior in their accessors may warrant full XML documentation. - Methods, events, classes, and other types should have XML documentation.
For event handler and command methods, tags may be ommitted. - Complex or unclear behavior within a method should include comments.