Question: The main application should create a CancellationTokenSource and two ManualResetEvent objects. Then the main application should create an instance of the Dot class passing the
The main application should create a CancellationTokenSource and two ManualResetEvent objects.
Then the main application should create an instance of the Dot class passing the cancellation token and one of the manual reset event objects to the constructor. The application should then create a foreground thread to run the ShowDot method and start it running.
Then the main application should create an instance of the Dash class. The application should then start the ShowDash method running using a thread pool thread and passing the cancellation token and the other manual reset event object to the method.
Once the threads are running, the main application should get a key from the user (use Console.ReadKey so the user does not have to press ENTER). If the user pressed a, the appication should set the dot manual reset event. If the user pressed s, the application should reset the dot manual reset event. If the user pressed z, the application should set the dash manual reset event. If the user pressed x, the application should reset the dash manual reset event. Finally, if the user pressed q, the application should signal cancellation for the threads and exit. The application will continue getting input from the user until q is pressed.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
