Access .NET indexed properties and collections
- Last Updated: January 17, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
Syntax
ABL supports access to .NET indexed properties. In .NET, an indexed property has a group of values. Each of these property values is referenced by an indexer that can be defined with one or more keys. In ABL, you can only reference an indexed property whose indexer is defined with one key, as shown in the following syntax:
|
The object-reference is a
reference to an instance of .NET class that has an indexed
property you want to reference. The property-name is
the name of the indexed property, and key is
a key value expression of a specified data type that identifies
a particular property value. The range of valid values for key depends
entirely on its definition, regardless of the data type. Like the
syntax for accessing an ABL array, the square brackets of the indexer
([ ]) for an indexed property are part
of the syntax.
Microsoft .NET class
library documentation identifies indexed properties using the following
indications: it typically is defined as a default property with the
name, Item (see Default indexed properties), and the language-specific
property signature always includes an index definition. For example,
a C# indexed property definition might be shown as in the following
example of some Control property, where this refers
to the class in which the indexed property is defined and index identifies
the data type of the single indexer key:
|
.NET primarily uses indexed properties to access the items of collections, which are objects that allow you to manage collections of other objects. OpenEdge also provides indexed properties on its OpenEdge .NET class, Progress.Data.BindingSource (ProBindingSource). For more information on the ProBindingSource, see Bind ABL data to .NET controls.