ECMA-334 C# Language Specification20.2.2: Interface properties |
Interface properties are declared using interface-property-declarations:
attributes
optnew opt type
identifier
{
interface-accessors
}
attributes
opt get
;
attributes
opt set
;
attributes
opt get
;
attributes
opt set
;
attributes
opt set
;
attributes
opt get
;
The attributes, type, and identifier of an interface property declaration have the same meaning as those of a property declaration in a class (17.6).
The accessors of an interface property declaration correspond to the accessors of a class property declaration (17.6.2), except that the accessor body must always be a semicolon. Thus, the accessors simply indicate whether the property is read-write, read-only, or write-only.