TAILIEUCHUNG - Visual Basic 2005 Design and Development - Chapter 12

Attributes and XML Comments Cửa sổ Properties và IntelliSense làm một công việc đáng chú ý tìm ra cách của bạn đối tượng và tính chất công việc của họ. Ví dụ, giả sử chương trình của bạn sử dụng đoạn mã sau để xác định JobTypes liệt kê giá trị và chương trình con AssignJob: Công Enum JobTypes Thiết kế Tài liệu phát triển Kiểm tra Debugging End Enum Private Sub AssignJob (ByVal job_type Như JobTypes) . End Sub. | Attributes and XML Comments The Properties window and IntelliSense do a remarkable job of figuring out how your objects and their properties work. For example suppose your program uses the following code to define the JobTypes enumerated values and the AssignJob subroutine Public Enum JobTypes Design Documentation Development Testing Debugging End Enum Private Sub AssignJob ByVal job_type As JobTypes . End Sub If you type AssignJob in the code window IntelliSense automatically displays all of the information shown in Figure 12-1. It shows the AssignJob subroutine s signature below the cursor it displays the list of possible JobTypes values that you could use for the subroutine s first parameter and it even displays the numeric value of the currently selected JobTypes value. Figure 12-1 IntelliSense automatically displays a subroutine s signature and lists possible JobTypes values. Part II Meta-Development Similarly the Properties window automatically discovers the types of the properties provided by a component and supplies appropriate editors in many cases. For example it automatically provides dropdowns for selecting colors or enumerated values dialogs for selecting files or colors and a combination of sub-properties and a dialog for selecting fonts. Visual Studio provides all of this support automatically. Although all of these tools are extremely useful Visual Studio cannot deduce the intent of your code. IntelliSense can list the signature of the Assignjobs subroutine but it cannot guess the routine s purpose. It can display a list of the possible values that you might use for the routine s parameter but it doesn t know what the parameter is for. By using attributes and XML comments you can give additional information that IntelliSense and editors such as the Properties window can use to provide extra support for developers. In most cases adding this support takes only a few seconds but giving developers a better understanding of what the code is supposed to .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.