PrepAway - Latest Free Exam Questions & Answers

Which code segment should you use?

You want to execute an event handler asynchronously from a Windows Form. You need to write code that uses the BackgroundWorker component named bgwExecute to execute the WorkHandler method. Which code segment should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
EventHandler work = new EventHandler(WorkHandler);
bgwExecute.RunWorkerAsync(Work);

B.
ThreadStart tsBackground = new ThreadStart(WorkHandler);
bgwExecute.ReporterProgress(100, tsBackground);

C.
ThreadStart tsBackground = new ThreadStart(WorkHandler);
bgwExecute.RunWorkerAsync(tsBackground);

D.
bgwExecute.DoWork += new Do WorkEventHandler(WorkHandler);
bgwExecute.RunWorkerAsync();


Leave a Reply