Disposable.cs 511 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace CommonAI
  6. {
  7. abstract public class Disposable : IDisposable
  8. {
  9. public bool IsDesposed { get { return disposedValue; } }
  10. private bool disposedValue = false;
  11. protected abstract void Disposing();
  12. public void Dispose()
  13. {
  14. if (!disposedValue)
  15. {
  16. disposedValue = true;
  17. Disposing();
  18. }
  19. }
  20. }
  21. }