Inline Property Accessors
From The Oxygene Language Wiki
This is a Language topic
Feel free to add your notes to this topic below.
Delphi Prism provides Inline Property Accessors, which is a feature that makes it possible to have a full expression in the read part of the property, instead of having to write a getter method to do this. Delphi Prism supports almost all expressions in the read property. The write section also supports complex expressions, but they're required to be either a function matching the property setter or a field or property that is writable.
type MyList = class private fInnerList: List<String> := new List<String>; public property ItemLength[i: Integer]: Integer read Length(fInnerList[i]); property Item[i: Integer]: String read fInnerList[i] write fInnerList[i]; end;
See Also
Area: Oxygene Language
Compiler version: Oxygene 5
Language Glossary — Keywords — Types — FAQ — How To