Need To Have A Global Collection

  • Thread starter Thread starter Octavie van Haaften
  • Start date Start date
O

Octavie van Haaften

Hai,

I'm building a WinForms application and I have a custom
collection that I need to use in all my forms. The
collection will be filled in just one form, but will be
accessed in all the other forms. How to?

grtz,
Octavie
 
Hi,

Inherit from the CollectionBase class and implement the derived class as a
Singleton (one of the design patterns by the Gang of Four). This will result
in that only a single collection instance will exist. Also bear in mind that
if your application is multi-threaded, you will have to add thread safety to
the collection.
 
Back
Top