- private void cButton_Click(object sender, RoutedEventArgs e)
- {
- interrupt_worker = true;
-
-
- }
and my attempts to exit the do worker loop by checking whether cancellation pending is not returning the dataset and exceptions are shown with do worker completed block
my do worker block code is like:
- foreach (SearchResult resEnt in mySearcher.FindAll())
- {
-
- if (interrupt_worker)
- {
- interrupt_worker = false;
- break;
-
- }
-
-
-
-
-
-
-
-
I know I am doing something wrong, please correct me.
Thanks