C#-Indexed Properties?

后端 未结 3 1202
余生分开走
余生分开走 2021-01-19 16:35

I\'ve been using Visual Basic for quite a while and have recently made the decision to begin learning C# as a step forward into learning more complex languages.

As a

3条回答
  •  庸人自扰
    2021-01-19 17:04

    Since C# doesn't support parameterized properties (which is what you are showing), you need to convert this code to two functions, a GetAProperty(index) and a SetAProperty(index).

    We converted a 50,000+ LOC application from VB to C# and it required extensive modifications like this due to the dependence on parameterized properties. However, it is doable, it just requires a different way of thinking about properties like this.

提交回复
热议问题