0
我試圖從SkyDrive下載一個文件,並在同步類中包裝了異步調用。然而,當我打電話給WaitOne時,一切都被阻止,EventHandeler永遠不會被調用。WP7&Skydrive WaitOne阻止了一切
_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();
}