/// <summary> /// Release the resources and disconnect /// </summary> private void disconnectBaos() { try { if (baosEvent != null) { baosEvent.disable(); } if (baosConnection != null) { baosConnection.disconnect(); baosConnection.Dispose(); } } catch (kdrive.KdriveException exception) { MessageBox.Show(exception.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }