In MSDN example for IDisposable, it has the followin
----------------------------------------------------------------------------
// Implement IDisposable
// Do not make this method virtual
// A derived class should not be able to override this method
public void Dispose(
Dispose(true)
// This object will be cleaned up by the Dispose method
// Therefore, you should call GC.SupressFinalize t
// take this object off the finalization queue
// and prevent finalization code for this objec
// from executing a second time
GC.SuppressFinalize(this)
----------------------------------------------------------------------------
Could someone explains me why "Dispose method can not be virtual, A derived class should not be able to override this method." I just want to do this in the base clas
public void Dispose(
DoDispose()
protected virtual void DoDispose(
And the derived class could override DoDispose method to do its own clean up work
Is this acceptable? Or this is confilict with "Dispose method can not be virtual,..." I just want to know the reason.
Thank you very very much