I suggest you to read the "remarks" section of the MSDN page of ManualResetEvent
which is pretty clear about the usage of this class.
To answer your specific question, the ManualResetEvent
is used to simulate a synchronous call to Download
even if it's asynchronous. It calls the async method and blocks until the ManualResetEvent
is signaled. The ManualResetEvent
is signaled within the event handler of the async event-based pattern. So basically it waits until the event is fired and the event handler is executed.