Question:You are developing an application to perform mathematical calculations. You develop a class named CalculationValues. You write a procedure named PerformCalculation that operates on an instance of the class. You need to ensure that the user interface of the application continues to respond while calculations are being performed. You need to write a code segment that calls the PerformCalculation procedure to achieve this goal. Which code segment should you use? 

A private void PerformCalculation() {
...
}
private void DoWork(){
CalculationValues myValues = new CalculationValues(); Thread newThread = new Thread(
new ThreadStart(PerformCalculation)); newThread.Start(myValues);
} 

B private void PerformCalculation (CalculationValues values) {
...
}
private void DoWork(){
CalculationValues myValues = new CalculationValues(); Application.DoEvents();
PerformCalculation(myValues);
Application.DoEvents();
} 

C private void PerformCalculation() {
...
}
private void DoWork(){
CalculationValues myValues = new CalculationValues(); ThreadStart delStart = new
ThreadStart(PerformCalculation);
Thread newThread = new Thread(delStart);
if (newThread.IsAlive) {
newThread.Start(myValues);
}
}
"A Composite Solution With Just One Click" - Certification Guaranteed 287 Microsoft 70-536 Exam 

D private void PerformCalculation(object values) {
...
}
private void DoWork(){
CalculationValues myValues = new CalculationValues(); Thread newThread = new Thread(
new ParameterizedThreadStart(PerformCalculation));
newThread.Start(myValues);
} 

+ Answer
+ Report
Total Preview: 952

Copyright © 2024. Powered by Intellect Software Ltd