Chapter 14 Quick Reference

Chương 14 Quick tham khảo để làm này Kê khai các loại tài sản, tên của nó, một nhận accessor, và accessor một bộ. Ví dụ: struct ScreenPosition (. công nhận int X ((. ) Tập hợp (. )) . ) Khai báo một tài sản chỉ với một nhận accessor. | Chapter 14 Quick Reference To Do this Declare the type of the property its name a get accessor and a set accessor. For example struct ScreenPosition Declare a read write property for a struct or class. . public int X get . set . . Declare a property with only a get accessor. For example struct ScreenPosition Declare a read-only property for a struct or class. . public int X get . . Declare a property with only a set accessor. For example struct ScreenPosition Declare a write-only property for a struct or class. . public int X set . . . . Declare a property with just the get or set keyword or both. For Declare a property in an J J J . example interface To Do this interface IScreenPosition int X get set no body int Y get set no body In the class or struct that implements the interface declare the property and implement the accessors. For example struct ScreenPosition IScreenPosition public int X Implement an interface property in a struct or class. get . set . public int Y get . set .

Bấm vào đây để xem trước nội dung
TÀI LIỆU MỚI ĐĂNG
Đã 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.