Method Dispose
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Remarks
This implementation guarantees that Dispose is an idempotent call and does NOT trigger any exceptions. That is, if already disposed, derived types will never see a call to Dispose(bool) as this will silently treat it as a NOP. Additionally, this follows the standard pattern such that finalization is suppressed when disposing.
Dispose(bool)
Abstract method that is implemented by derived types to perform the dispose operation
protected virtual void Dispose(bool disposing)
Parameters
disposing
boolIndicates if this is a dispose or finalize operation
Remarks
This is guaranteed to only be called if IsDisposed returns false
so the implementation should only be concerned with the actual release of resources. If disposing
is true then the implementation should release managed and unmanaged resources, otherwise it should
only release the unmanaged resources