|
using System;
using System.Collections.Generic;
using System.Text;
namespace Almdal.AutoPlayListener {
public class IDisposableImpl : IDisposable {
private bool _disposed = false;
#region Destructor
~IDisposableImpl() {
Dispose(false);
}
#endregion
#region IDisposable Members
public void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
#endregion
protected void Dispose(bool disposeManagedResources) {
// process only if mananged and unmanaged resources have
// not been disposed of.
if (!_disposed) {
if (disposeManagedResources) {
// dispose managed resources
DisposeManagedResources();
}
// dispose unmanaged resources
DisposeUnmanagedResources();
_disposed = true;
}
}
protected virtual void DisposeUnmanagedResources() { }
protected virtual void DisposeManagedResources() { }
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.