. NET Framework General Reference-capitalization Styles

Source: Internet
Author: User
Use the following three conventions for capitalizing identifiers.

Pascal case

The "identifier" and "the" the "the" and "the" "the" the "the" and "the" subsequent concatenated word can use Pascal case for identifiers of three or more characters. For example:

Camel case

The "a" identifier is lowercase and the ' a ' subsequent concatenated word is capitalized. For example:


All letters in the identifier are capitalized. Use this convention to identifiers that consist of two or fewer letters. For example:

You are might also have to capitalize identifiers-maintain with compatibility, existing symbol unmanaged, where all Uppercase characters are often used for enumerations and constant values. In general, these symbols should is visible outside of the assembly that uses them.

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

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 is preferable to using a protected instance field.
Public instance field Pascal Redvalue
Note rarely used. A is preferable to using a public instance field.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.