Inheritance: StoppableBackgroundWorker
Exemplo n.º 1
0
 private void BackgroundWorker_Stopped(object sender, EventArgs e)
 {
     lock (this.backgroundWorkers)
     {
         CurrentTimeBackgroundWorker backgroundWorker = (CurrentTimeBackgroundWorker)sender;
         backgroundWorker.Stopped -= BackgroundWorker_Stopped;
     }
 }
Exemplo n.º 2
0
 private void CreateWorkerButton_Click(object sender, RoutedEventArgs e)
 {
     lock (this.backgroundWorkers)
     {
         CurrentTimeBackgroundWorker backgroundWorker = new CurrentTimeBackgroundWorker();
         backgroundWorker.Stopped += BackgroundWorker_Stopped;
         backgroundWorker.Start();
         this.backgroundWorkers.Add(backgroundWorker);
         DestroyWorkerButton.IsEnabled = true;
     }
 }