예제 #1
0
        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();
            }
        }
예제 #2
0
 public virtual void CancelSearch()
 {
     if (SearchWorker != null)
     {
         SearchWorker.CancelAsync();
     }
     SearchWorker = null;
 }
예제 #3
0
 public void CancelSearch()
 {
     if (!CancelPending)
     {
         SearchWorker.CancelAsync();
         CancelPending = true;
     }
 }
예제 #4
0
        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();
            }
        }
예제 #5
0
 private void CancelSearchButtonClick(object sender, EventArgs e)
 {
     SearchProgressStatusLabel.Text = "Canceling...";
     CancelSearchButton.Enabled     = false;
     SearchWorker.CancelAsync();
 }