Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (7.3 KB, 2 trang )
Chapter 14 Quick Reference
To Do this
Declare a read/write
property for a struct or
class.
Declare the type of the property, its name, a get accessor, and a
set accessor. For example:
struct ScreenPosition
{
...
public int X
{
get { ... }
set { ... }
}
...
}
Declare a read-only
property for a struct or
class.
Declare a property with only a get accessor. For example:
struct ScreenPosition
{
...
public int X
{
get { ... }
}
...