C# Language Capitalization conventions


Example

The following terms describe different ways to case identifiers.

Pascal Casing

The first letter in the identifier and the first letter of each subsequent concatenated word are capitalized. You can use Pascal case for identifiers of three or more characters. For example: BackColor

Camel Casing

The first letter of an identifier is lowercase and the first letter of each subsequent concatenated word is capitalized. For example: backColor

Uppercase

All letters in the identifier are capitalized. For example: IO


Rules

When an identifier consists of multiple words, do not use separators, such as underscores ("_") or hyphens ("-"), between words. Instead, use casing to indicate the beginning of each word.

The following table summarizes the capitalization rules for identifiers and provides examples for the different types of identifiers:

IdentifierCaseExample
Local variableCamelcarName
ClassPascalAppDomain
Enumeration typePascalErrorLevel
Enumeration valuesPascalFatalError
EventPascalValueChanged
Exception classPascalWebException
Read-only static fieldPascalRedValue
InterfacePascalIDisposable
MethodPascalToString
NamespacePascalSystem.Drawing
ParameterCameltypeName
PropertyPascalBackColor

More information can be found on MSDN.