Complex threading
You don't mention it, but I assume this whole process is triggered by some user input on the UI. The first thing you should do is use another thread - lets call it thread A - to call
BOM_Explosion_Costing_Level_One so that the UI thread is not blocked. As you've described it, the server side code sounds fine.
The delegate method on the client sounds the most problematic. When the server invokes this, it will be on a different thread - lets call it thread B. Normally, you would just test
InvokeRequired and if true, marshall the call to the UI thread using
Invoke. However, this would cause the original call to return, rather than wait for UI input. Therefore, after calling
Invoke, you need to make thread B wait, perhaps using a wait object such as
AutoResetEvent. When the necessary input has occurred on the UI and the result is ready to be returned to the server, the UI thread calls
Set on the AutoResetEvent, causing the thread B to unblock and be able to return the result to the server.
When the server completes its processing, the
BOM_Explosion_Costing_Level_One method returns and thread A can then display the cost - again using
Invoke.
Good luck