欢迎光临
我们一直在努力

.NET Framework General Reference – Capitalization Styles-.NET教程,.NET Framework

建站超值云服务器,限时71元/月

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.

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » .NET Framework General Reference – Capitalization Styles-.NET教程,.NET Framework
分享到: 更多 (0)

相关推荐

  • 暂无文章