C# object initialization of read only collection properties

后端 未结 4 1611
南笙
南笙 2020-11-27 21:11

For the life of me, I cannot figure out what is going on in the example piece of C# code below. The collection (List) property of the test class is set as read only, but ye

4条回答
  •  忘掉有多难
    2020-11-27 21:40

    The StringCollection property doesn't have a setter so unless you add one you cannot modify its value.

提交回复
热议问题