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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top