·您的位置: 首页 » 资源教程 » 编程开发 » ASP.NET » .NET Framework General Reference - Capitalization Styles

.NET Framework General Reference - Capitalization Styles

类别: ASP.NET教程  评论数:0 总得分:0
Use the following three conventions for capitalizing identifiers.

Pascal case

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 case

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. Use this convention only for identifiers that consist of two or fewer letters. For example:

System.IO
System.Web.UI
You might also have to capitalize identifiers to maintain compatibility with existing, unmanaged symbol schemes, where all uppercase characters are often used for enumerations and constant values. In general, these symbols should not be visible outside of the assembly that uses them.

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

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.



-= 资 源 教 程 =-
文 章 搜 索
关键词:
类型:
范围:

纯粹空间 softpure.com
Copyright © 2006-2012 暖阳制作 版权所有
承接程序设计 网页设计
QQ: 15242663 (隐身在线 拒绝闲聊)  Email: faisun@sina.com

 纯粹空间 - 韩国酷站|酷站欣赏|教程大全|资源下载|免费博客|美女壁纸|设计素材|技术论坛  

百度搜索 谷歌搜索 Alexa搜索 | 粤ICP备19116064号-1