protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); }
protected override void OnClosing(CancelEventArgs e) { base.OnClosing(e); _db.Dispose(); if (_foodWin != null && _foodWin.IsLoaded) { _foodWin.Close(); } }
protected virtual void Dispose(bool disposing) { if (!this.disposed) { if (disposing) { context.Dispose(); } } this.disposed = true; }