Releasing Classes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dominic

    #1

    Releasing Classes

    Hi,

    I've a separated class DOIT with a function WATCH which is
    dynamically creating FileSystemWatch ers.

    In an other project I'm creating a new instance of DOIT
    and start my function WATCH. So far so good....

    I'm setting the Instance DOIT later in the application to
    NOTHING, but all created FileSystemWatch ers are still
    running. How can I release/dispose a whole instanced class
    within a project ? Or how can I kill all
    FileSystemWatch ers at one time (but I d'ont know how many
    there are) ?

    Many thanks for any help !
    Cheers,
    Dominic
  • Jay B. Harlow [MVP - Outlook]

    #2
    Re: Releasing Classes

    Dominic,
    I would have the DOIT class implement the IDisposable interface. Instead of
    setting the DOIT variable to Nothing, I would call the DOIT.Dispose method.
    Within the Dispose method I would have it "shut down" each of the
    FileSystemWatch ers, that this instance of the DOIT class created earlier.

    This may mean that DOIT would need an internal ArrayList to hold each
    instance of any dynamically created FileSystemWatch ers that were created.

    Hope this helps
    Jay

    "Dominic" <dominic.birrer @first-solution.com> wrote in message
    news:02ae01c3b9 02$9d28dd40$a10 1280a@phx.gbl.. .[color=blue]
    > Hi,
    >
    > I've a separated class DOIT with a function WATCH which is
    > dynamically creating FileSystemWatch ers.
    >
    > In an other project I'm creating a new instance of DOIT
    > and start my function WATCH. So far so good....
    >
    > I'm setting the Instance DOIT later in the application to
    > NOTHING, but all created FileSystemWatch ers are still
    > running. How can I release/dispose a whole instanced class
    > within a project ? Or how can I kill all
    > FileSystemWatch ers at one time (but I d'ont know how many
    > there are) ?
    >
    > Many thanks for any help !
    > Cheers,
    > Dominic[/color]


    Comment

    Working...