protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); }
public virtual void Dispose(bool disposing) { if (!this.disposed) { if (disposing) { db.Dispose(); } this.disposed = true; } }
private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { mdb.Dispose(); }
/// <summary> /// 销毁对象 /// </summary> public void Dispose() { _db.Dispose(); }