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.ReportProgress(100,tsBackground);

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

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


Leave a Reply