private void Window_Closing_1(object sender,CancelEventArgs e) { loggingService.Logout(); IsConnected = false; foreach (var devCtrl in _pm.DeviceControls) { devCtrl.Dispose(); } Ambassador.Dispose(); if (_progressBar != null) { if (_fileOperationRes == BiosecLibClient.CryptoOperationRes.BIOSEC_NO_ERROR) { if (_options.IsSecure) { _progressBar.HideWindowAfter(3000,"Encryption complete"); } else { _progressBar.HideWindowAfter(3000,"Decryption complete"); } } else { _progressBar.Destroy(); } } if (_errorWindow != null) { _errorWindow.Close(); } _stopFillingList = true; if (_fileListFiller != null) { _fileListFiller.Join(); } if (_fileChooser != null) { _fileChooser.Destroy(); } _libClient.dispose(); }