예제 #1
0
 /// <summary>
 /// 清理所有正在使用的资源。
 /// </summary>
 /// <param name="isDisposing">如果应释放托管资源,为 true;否则为 false</param>
 protected static void Dispose(bool isDisposing)
 {
     if (_alreadyDisposed)
         return;
     if (isDisposing)
     {
         comn = null;
         _instance = null;
         //GC.SuppressFinalize(this);
     }
     _alreadyDisposed = true;
 }
예제 #2
0
 /// <summary>
 /// 清理所有正在使用的资源。
 /// </summary>
 /// <param name="isDisposing">如果应释放托管资源,为 true;否则为 false</param>
 protected static void Dispose(bool isDisposing)
 {
     if (_alreadyDisposed)
     {
         return;
     }
     if (isDisposing)
     {
         comn      = null;
         _instance = null;
         //GC.SuppressFinalize(this);
     }
     _alreadyDisposed = true;
 }
예제 #3
0
 static DbCommon()
 {
     _instance = new DbCommon();;
 }
예제 #4
0
 /// <summary>
 /// 切记:引用完类组件后,一定要调用此方法来释放!
 /// </summary>
 public static void Dispose()
 {
     DbCommon.Dispose();
 }
예제 #5
0
 static DbCommon()
 {
     _instance = new DbCommon(); ;
 }