Can't you wrap any non async method in a asynchronous call using asynchronous delegates? My reference is this link.
Ok So did you make your async call something like this ...
private delegate <returnType> YouTubeAPI( <args> )
private YouTubeAPI func;
private IAsyncResult ticket;
void YouTubeSearchFunc( string what )
{
func = <whatever the you tube call is>
ticket = func.BeginInvoke( <args needed> );
// WE MUST do this in order to return flow of control to program
return;
}
// later we need to check if the ticket is done and then get it
if ( ticket.IsComplete == true )
// get it
else
// continue on like normal
The reason we cant just immediately get the value is because that will block the program. This is exactly what we don't want to do. So instead, we have to structure the program in a way that we check to see if its done on a separate update. This lets Win-forms or GTK run so that it doesn't look like it hangs. UNFORTUNATELY, this is a pain in the butt. What you probably want to do is just use a background worker. Read this part HERE and see if this doesn't help you more because BackgroundWorkers can have callbacks. Then all you have to do is set up a background worker, and then hook your update function into the completed event.