I'm trying to download a file from SkyDrive and have wrapped the Asynchronous calls in a Synchronous class. However when I'm call WaitOne everything is blocked and the EventHandeler never gets called.
_client = new LiveConnectClient(connection.Session);
_client.GetCompleted += new EventHandler<LiveOperationCompletedEventArgs>(client_GetCompleted);
_client.GetAsync("me/skydrive/files");
_autoEvent.WaitOne(); //get's stuck here client_GetCompleted never called.
....
void client_GetCompleted(object sender, LiveOperationCompletedEventArgs e)
{
///do stuff
_autoEvent.Set();
}
Remove the _autoEvent.WaitOne() call and the get completed event will be raised.