Peter Duniho
7/21/2008 4:09:00 PM
On Mon, 21 Jul 2008 05:13:22 -0700, Bonghi <claudio.benghi@gmail.com>
wrote:
> [...]
> This seems to work, but I'm wondering if there's a better way of
> sharing information structures across controls and form. Any
> suggestion is welcome.
Other than the apparently pointless use of the "ref" keyword, I don't see
anything specifically wrong about the code you posted. However, if you're
interested in _doing_ something when the list instance is modified, you
might prefer to use the BindingList class rather than List. That class
provides events to notify you of changes to the list.
It's not clear how in the code you posted you would be detecting changes
to the list, but whatever you're doing, I think BindingList would probably
work better, since it's designed for that purpose.
Pete