BooleanDisposable.cs 463 B

12345678910111213141516171819202122232425
  1. using System;
  2. using System.Collections;
  3. namespace UniRx
  4. {
  5. public sealed class BooleanDisposable : IDisposable, ICancelable
  6. {
  7. public bool IsDisposed { get; private set; }
  8. public BooleanDisposable()
  9. {
  10. }
  11. internal BooleanDisposable(bool isDisposed)
  12. {
  13. IsDisposed = isDisposed;
  14. }
  15. public void Dispose()
  16. {
  17. if (!IsDisposed) IsDisposed = true;
  18. }
  19. }
  20. }