private void MRunSelectedClick( object sender, EventArgs e ) { BackgroundScriptRunner backgroundScriptRunner = new BackgroundScriptRunner(); backgroundScriptRunner.ProgressChanged += BackgroundScriptRunnerProgressChanged; RunSelectedFile(backgroundScriptRunner); }
private void RunSelectedFile( BackgroundScriptRunner backgroundScriptRunner ) { if (gvFileList.SelectedRows.Count != 1) return; SiqualFileDisplay fileDisplay = gvFileList.SelectedRows[0].DataBoundItem as SiqualFileDisplay; if (fileDisplay == null) return; statusLabel.SetInWork(); backgroundScriptRunner.RunScript(SiqualRunnerContext.SelectedServer, fileDisplay.Id, chkRunAtomic.Checked); }
private void BtnRunScriptsClick( object sender, EventArgs e ) { BackgroundScriptRunner backgroundScriptRunner = new BackgroundScriptRunner(); backgroundScriptRunner.ProgressChanged += BackgroundScriptRunnerProgressChanged; switch (_filesSelectedInGridStatus) { case EnumFilesSelectedInGrid.NoFiles: statusLabel.SetInWork(); backgroundScriptRunner.RunNewScripts(SiqualRunnerContext.SelectedServer, chkRunAtomic.Checked); break; case EnumFilesSelectedInGrid.OneFile: RunSelectedFile(backgroundScriptRunner); return; case EnumFilesSelectedInGrid.MultipleFiles: { IList<int> ids = GetFileIdsFromSelectedRows(); statusLabel.SetInWork(); backgroundScriptRunner.RunScripts(SiqualRunnerContext.SelectedServer, ids, chkRunAtomic.Checked); } break; default: throw new ArgumentOutOfRangeException(); } }