I have a three part question concerning the proper use of Dispose --
specifically when I have a collection of elements (contianed in an
ArrayList) that each implement the IDisposable interface.
First, if my class declares disposable members, then I must also
implement IDispoable. Is thsi correct? In my case, I don't really
have any disposable members though - I have an ArrayList of disposable
members. But since my class is creatign and managing these objects, it
seems I must dispose them. Is this correct?
Second, In my class's Dispose method, can I simply 'clear' the
ArrayList or must I Dispose each element separately?
Finally, what should I do when my class is not being disposed, but
simply [permanently] removing an object from the ArrayList. Is it
sufficient to simply remove all handles and let it be collected in
normal fashion? Or must I explicitly Dispose each object when I am
done with it.
Thank you!
Chris