You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
686 B

6 years ago
  1. using System;
  2. namespace Microsoft.Win32.Security
  3. {
  4. /// <summary>
  5. /// Abstract base class for any disposable object.
  6. /// Handle the finalizer and the call the Gc.SuppressFinalize.
  7. /// Derived classes must implement "Dispose(bool disposing)".
  8. /// </summary>
  9. public abstract class DisposableObject : IDisposable
  10. {
  11. #region IDisposable Members
  12. public void Dispose()
  13. {
  14. Dispose(true);
  15. GC.SuppressFinalize(this);
  16. }
  17. #endregion
  18. ~DisposableObject()
  19. {
  20. Dispose(false);
  21. }
  22. protected abstract void Dispose(bool disposing);
  23. }
  24. }