使用以下三命名法来标示字符
Pascal case
标识符和每个后续的串连词的第一个字母都是大写;三个或更多字符的情况下可以使用Pascal命名法。
For example:BackColor
Camel case(骆驼式命名法)
标识符的第一个字母是小写字母和第一个字母后面连接的每个单词的首字母都大写。
For example:backColor
Upper case(大写命名)
标识符中的所有字母都大写。本公约只使用标识符构成的2个或更少的字母。
For example:
System.IO
System.Web.UI
你也可能利用标识符保持兼容现有的象征,托管方案,所有字符大写通常用于枚举和常数的值。一般来说,这些符号应该是不可见的外部组件使用他们的。
下表总结了大写规则,并提供不同类型的标识符的例子。
| Identifier | Case | Example |
| Class | Pascal | AppDomain |
| Enum type | Pascal | ErrorLevel |
| Enum values | Pascal | FatalError |
| Event | Pascal | ValueChange |
| Exception class | Pascal | WebException Note Always ends with the suffix Exception. |
| Read-only Static field | Pascal | RedValue |
| Interface | Pascal | IDisposable Note Always begins with the prefix I. |
| Method | Pascal | ToString |
| Namespace | Pascal | System.Drawing |
| Parameter | Camel | typeName |
| Property | Pascal | BackColor |
| Protected instance field | Camel | redValue Note Rarely used. A property is preferable to using a protected instance field. |
| Public instance field | Pascal | RedValue Note Rarely used. A property is preferable to using a public instance field. |