Properties declared in an
interface are accessible only through expressions of the interface type; they
cannot be accessed through class-type variables. Moreover, interface properties
are visible only within programs where the interface is compiled. For example,
on Windows, COM objects do not have properties.
In an interface, property read and write specifiers must be methods, since fields are not available.
在接口声明中,只有通过接口类型表达式声明的属性是可访问的;这些属性不能通过类类型变量被访问。此外,接口属性仅在接口被编译的程序中是可见的。例如,在Windows中,COM对象没有属性。
在接口中,属性的read和write说明符必须是方法,因为域是不可用的。