Starting processes in separate threads
In the previous recipe, we developed a NavServiceController
.NET component that is capable of retrieving information on the status of available NAV services. Now we will add control functionality to the same component. With the new version of the service controller, it will be possible to start and stop services. Control tasks will be started in background threads to avoid UI freeze on long-running processes. To report task execution status, the service controller will raise custom events handled by a NAV host object.
Getting ready
The current example is based on the NavServiceController
assembly developed in the Developing your own .NET class recipe. The prerequisite walkthrough must be completed prior to starting the current exercise.
How to do it...
Start Visual Studio and open the
NavServiceController
solution from the previous recipe.Open the Solution Explorer window and right-click on the solution name. Select Add, then Class from the drop-down menu...