Fixes #17190: SerializationException on ListViewItemCount (#17195)
commit4ec9bd03e509c610c95cd538c26091b873276491
authorLeonard <leonard.r.koenig@googlemail.com>
Fri, 25 Oct 2019 17:30:08 +0000 (25 19:30 +0200)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Fri, 25 Oct 2019 17:30:08 +0000 (25 19:30 +0200)
treec2f3c3e1fc1699d1329ca39eb30fe6bc26d58ca1
parent1bd76c6069f347a5596d98d40a2a76111639e958
Fixes #17190: SerializationException on ListViewItemCount (#17195)

* Fix issue #17190: SerializationException on ListViewItemCount

ListViewGroup doesn't (always) have a serialized member "ListViewItemCount".

This patch accounts for that and also adds support for the "ItemsCount"
property that upstream [1] seems to use.

Also items should be initialized regardless of the count, otherwise we get a NPE.

[1] https://github.com/dotnet/winforms/blob/master/src/System.Windows.Forms/src/System/Windows/Forms/ListViewGroup.cs#L144
mcs/class/System.Windows.Forms/System.Windows.Forms/ListViewGroup.cs