User Tools

Site Tools


notes:csharp:indexers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
notes:csharp:indexers [2018/12/03]
leszek
notes:csharp:indexers [2018/12/03]
leszek
Line 7: Line 7:
   * declared in interfaces   * declared in interfaces
   * read-only or read-write   * read-only or read-write
 +  * can have separate access restrictions for setters and getters
   * single-dimension indexers with numeric parameters can participate in data binding   * single-dimension indexers with numeric parameters can participate in data binding
 +
 +Keep in mind that:
 +  * 'get' accessors should not have observable side effects
 +  * when the JIT compiler inline property accessors, the performance of data members and properties is the same
  
 Example: Implement an indexer: Example: Implement an indexer: