/// <summary> /// 实现了IDisposable接口的类。 /// </summary> public class ConnectionManager : IDisposable {     #region IDisposable模式      /// <summary>     /// 析构函数。     /// </summary>     ~ConnectionManager()     {         Dispose(false);     }      /// <summary>     /// 真正的释放资源函数。     /// </summary>     /// <param name="disposing"></param>     protected virtual void Dispose(bool disposing)     {         if (disposing)         {             // Clean up all managed resources that is finalizable             // ...         }         // Clean up all native resources         // ...     }      /// <summary>     /// 提供使用者一个显式释放资源的方法。     /// </summary>     public void Dispose()     {         Dispose(true);         // Tell the GC not to execute the deconstructor any more         GC.SuppressFinalize(this);     } }

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2021-11-09
  • 2022-12-23
  • 2022-03-03
  • 2022-12-23
  • 2021-07-03
猜你喜欢
  • 2022-12-23
  • 2021-09-23
  • 2021-08-12
  • 2021-10-11
  • 2021-11-12
  • 2021-11-16
  • 2022-12-23
相关资源
相似解决方案