private void DoWork(RunWorkerArgument arg) { if (arg.PreviousConnection != null) { if (ConfigHandler.EnableCLRTemporary) { arg.PreviousConnection.DisableCLR(); } if (!_shiftPressed && !ConfigHandler.KeepSessionOnExit) { if (!_manuallyUseSession || (_manuallyUseSession && GenericHelper.ConfirmDropTempTable(arg.SessionnId))) { arg.PreviousConnection.DropTempTable(string.Format("TraceData_{0}", arg.SessionnId.Replace("'", "''"))); } } } DatabaseOperation databaseOperation = arg.DatabaseOperation; bool enableCLR = HandleCLREnabled(databaseOperation); if (enableCLR) { databaseOperation.HandleCLR(); } GenericHelper.SqlServerName = databaseOperation.GetSqlServerName(); GenericHelper.SqlServerVersion = databaseOperation.GetSqlServerVersion(); databaseOperation.InitializeDatabaseActions(); if (enableCLR) { databaseOperation.DeployCLR(); } ConfigHandler.ClrDeployed = databaseOperation.IsCLREnabled(); ConfigHandler.SetRecordTraceFileDirectory(databaseOperation); }
private void Cleanup() { Hide(); if (ConfigHandler.EnableCLRTemporary) { _databaseOperation.DisableCLR(); } if ((ModifierKeys != Keys.Shift && !ConfigHandler.KeepSessionOnExit && !_unattendedUseSessionParameter) || _forceDelete) { if (!inputSourceUserControl1.GetManuallyUseSession() || (inputSourceUserControl1.GetManuallyUseSession() && GenericHelper.ConfirmDropTempTable(GenericHelper.GetSessionIdFromTableName()))) { _databaseOperation.DropTempTable(GenericHelper.TempTableName.Replace("'", "''")); } } _databaseOperation.Dispose(); if (!_unattended && ConfigHandler.RegistryModifyAccess) { SessionHelper.SaveSession(); } }