Results 1 to 5 of 5

Thread: Class object collection?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Location
    Lelystad, Netherlands
    Posts
    73

    Class object collection?

    Can someone tell me what is the best way to create
    a collection of objects from classes?

    I tried using the component container like it is made
    when using components in VS, but it doesn't work.
    Code:
    this.components = new System.ComponentModel.Container();
    this.myClass = new theClass(this.components);
    The reason I want this is to be able to dispose the
    objects created.
    Greetz,
    John

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Location
    Lelystad, Netherlands
    Posts
    73
    Or is there perhaps a Global Event one can create.

    Like a Global_Dispose which runs on all objects when called.
    Greetz,
    John

  3. #3
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    I don't understand what you are trying to do. If the objects go out of scope, then the built in garbage collector will take care of them. You don't need to do anything. If an object is a huge resource hog, then you should call it's dispose method, and maybe do a forced garbage collection.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Location
    Lelystad, Netherlands
    Posts
    73
    Well I am trying to make a server app which can have multiple
    threads and it has plugins. When a session/thread ends it
    should dispose the objects/plugins that it used during the
    session. This is what I'm trying to do.
    What kind of collection should I use for the plugin objects to
    be able to dispose them?
    Greetz,
    John

  5. #5
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    HashTable obj maybe !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width