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 ...)