private void SearchButton_Click(object sender, EventArgs e) { int runFlag = 1; if (SearchBox.Text == "") { ClassBackEnd.Book.Clear(); nPage = 1; DataSheetLoad(1); return; } NoResultTextBox.Hide(); AddBookButton.Hide(); ResultDataSheet.Rows.Clear(); lastState = ButtonState; lastString = SearchBox.Text; LoadGIFBox.Show(); if (SearchWorker.IsBusy) { runFlag = 0; SearchWorker.CancelAsync(); } if (runFlag != 0) { SearchWorker.RunWorkerAsync(); } }
public virtual void CancelSearch() { if (SearchWorker != null) { SearchWorker.CancelAsync(); } SearchWorker = null; }
public void CancelSearch() { if (!CancelPending) { SearchWorker.CancelAsync(); CancelPending = true; } }
private void SearchButton_Click(object sender, EventArgs e) { int runFlag = 1; ResultDataSheet.Rows.Clear(); lastState = ButtonState; lastString = SearchBox.Text; LoadGIFBox.Show(); if (SearchWorker.IsBusy) { runFlag = 0; SearchWorker.CancelAsync(); } if (runFlag != 0) { SearchWorker.RunWorkerAsync(); } }
private void CancelSearchButtonClick(object sender, EventArgs e) { SearchProgressStatusLabel.Text = "Canceling..."; CancelSearchButton.Enabled = false; SearchWorker.CancelAsync(); }