class Test : IDisposable
   {
     private bool isDisposed = false;
   
     ~Test()
     {
       Dispose(false);
     }
   
     protected void Dispose(bool disposing)
     {
       if (disposing)
       {
         // Code to dispose the managed resources of the class
       }
       // Code to dispose the un-managed resources of the class
   
       isDisposed = true;
     }
   
     public void Dispose()
     {
       Dispose(true);
       GC.SuppressFinalize(this);
     }
   }

相关文章:

  • 2021-10-23
  • 2021-10-17
  • 2022-12-23
  • 2021-10-07
  • 2022-01-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-13
  • 2021-08-30
  • 2021-09-21
  • 2021-08-19
相关资源
相似解决方案