Properties are data members that trigger something when written to and can look data up and/or compute that data. Each property can consist of two "accessors": get and set. A property can be virtual, abstract, final, or part of an interface.
Any modifiers or access qualifiers applied the the property are also applied to its accessors unless they override those modifiers/access qualifiers. Properties shouldn't be treated as commands or functions. Think of them as a special kind of data member—only one that has a brain. Properties can't themselves be const or readonly, but the values they return can be if the property in question only has a get accessor. All properties must have at least one accessor. Properties can be static, but not accessors. The access qualifier for an accessor must be at least as restrictive as that applied to the property.
Properties can take parameters. These properties are called "indexed properties". You can also have a property using the self keyword as the identifier. It is accessed directly from your instance without an identifier and is always indexed. Indexed properties can use any syntax, but must start and end with brackets.
DASIL allows for properties outside a type. On the other hand, SASIL doesn't. For more on properties, see the section [Properties].
:::text
(\public\ | \protected\ | \private\) [{\virtual\ | \final\ | \abstract\}] [\static\] \property\ /identifier/ [\[\/DeclarationSequence/\]\]
[[(\protected\ | \private\)] [{\virtual\ | \final\ | \abstract\}] \get\
[\throws\ /ExceptionList/]
' return something
]
[[(\protected\ | \private\)] [{\virtual\ | \final\ | \abstract\}] \set\
[\throws\ /ExceptionList/]
' return something
]
For more on what /DeclarationSequence/ can be, see Declaration sequences.
To read from a property with a get accessor, simply treat it like a variable. If it's an indexed property, treat it like an array. To write to a property with a set accessor, do the same.
Wiki: Attributes
Wiki: Keywords
Wiki: Properties
Wiki: When is it a procedure, command, function, property, property accessor, method, complex statement, or type cast?
Wiki: keywords-abstract
Wiki: keywords-const
Wiki: keywords-final
Wiki: keywords-get
Wiki: keywords-interface
Wiki: keywords-set
Wiki: keywords-static
Wiki: keywords-value
Wiki: keywords-virtual