Daniel Cazzulino's Blog : Is IDisposable missing something???

Subscriptions

News

Source code published in this blog is public domain unless otherwise specified.

 

kzu in LinkedIn

  Microsoft MVP Profile

 Contact

Post Categories

Is IDisposable missing something???

Who about:

public interface IDisposable
{
      event EventHandler Disposed;
      void Dispose();
      bool IsDisposed { get; }
}
That would make it feasible to have features that monitor for the disposal of elements to do something (like cleanup related state, etc.). For the record, the Disposed event *is* exposed in the IComponent interface.... too bad it didn't make it to the IDisposable interface :( .... (at least I'd like the event ...)

posted on Wednesday, April 27, 2005 3:00 PM by kzu