IDisposeState.cs 669 B

123456789101112131415161718192021222324252627282930
  1. namespace Microsoft
  2. {
  3. /// <summary>
  4. /// 定义判断分配的资源是否已经释放的属性接口.
  5. /// Copyright (c) JajaSoft
  6. /// </summary>
  7. public interface IDisposeState
  8. {
  9. /// <summary>
  10. /// 分配的资源是否正在释放
  11. /// </summary>
  12. bool Disposing
  13. {
  14. get;
  15. }
  16. /// <summary>
  17. /// 分配的资源是否已经释放
  18. /// </summary>
  19. bool IsDisposed
  20. {
  21. get;
  22. }
  23. /// <summary>
  24. /// 检查是否已释放资源,如果已释放资源则抛出异常
  25. /// </summary>
  26. void CheckDisposed();
  27. }
  28. }