✅ Indexer return collection or single object depending on parameter
Hi all,
is there any way to selectively return either a single object or a collection of multiple objects depending on the given parameter?
I want to achieve the following behavior:
Let's say I have some class which references a table by Rows (alphabetically, e.g. A, B, C, ...) and Columns (numerically, e.g. 1, 2, 3, ...)
If I want to have a reference to the cell
Additionally, I would also like to be able to give ranges as the index. For example:
Is there any way of achieving such a behaviour?
Thank you very much for your help!
is there any way to selectively return either a single object or a collection of multiple objects depending on the given parameter?
I want to achieve the following behavior:
Let's say I have some class which references a table by Rows (alphabetically, e.g. A, B, C, ...) and Columns (numerically, e.g. 1, 2, 3, ...)
If I want to have a reference to the cell
A1 I would write the following:Additionally, I would also like to be able to give ranges as the index. For example:
Is there any way of achieving such a behaviour?
Thank you very much for your help!