I have been using Visual Basic for a long time and recently decided to start learning C # as a step forward in learning more complex languages.
As part of this transition, I decided to convert some of my old VB projects manually into C #. The problem I ran into is converting a library having a class using properties with arguments / indexes.
In VB, the property will be something like this:
Friend Property Aproperty(ByVal Index As Integer) As AClass Get Return Alist.Item(Index) End Get Set(ByVal value As KeyClass) Alist.Item(Index) = value End Set End Property
When I used the property, it will be used as follows:
Bclass.Aproperty(5) = new AClass
This is what I want to achieve in C #, but I canโt understand how much I can do this, since C # cannot do this.
source share