Danh mục

Enumerations

Số trang: 2      Loại file: pdf      Dung lượng: 10.69 KB      Lượt xem: 14      Lượt tải: 0    
10.10.2023

Xem trước 2 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

[ Team LiB ] A.7 Enumerations C# uses the enum statement along with opening and closing braces, { }, to indicate the beginning and end of an enumeration definition. For example: public enum CommandType { // Enumeration members }
Nội dung trích xuất từ tài liệu:
Enumerations[ Team LiB ]A.7 EnumerationsC# uses the enum statement along with opening and closing braces, { }, to indicate thebeginning and end of an enumeration definition. For example:public enum CommandType { // Enumeration members}In VB, an enumeration is defined by the Enum... End Enum construct. For example, theVB version of the CommandType enum declaration is:Public Enum CommandType enumeration membersEnd EnumIn both C# and VB, the member listing consists of the name of the enumerated memberand its value. These are identical in C# and VB, except that C# adds a comma to separateone member of the enumeration from another, whereas VB requires that they be onseparate lines. For example, the full declaration of the CommandType enumeration in C#is:public enum CommandType { Text = 1, StoredProcedure = 4, TableDirect = 512}The VB equivalent is:Public Enum CommandType Text = 1 StoredProcedure = 4 TableDirect = 512End Enum[ Team LiB ]

Tài liệu được xem nhiều: