facebook c# sdk async GetCompleted, why only 1 event?
I am attempting to create a WP7 facebook app using facebook c# sdk. For WP7 all requests are async. I want to use FQL to make multiple calls to Facebook. The only examples I can find show making 1 Facebook get request. The examples define a FacebookClient.GetCompleted event. How do I create a Callback handler for every request, when the only Event I can d开发者_如何学运维efine is GetCompleted?
For example for
FaceBookClient.QueryAsyn("Select Friend"...) & FaceBookClient.QueryAsyn("Select Albums...")how do I define a callback for each of these?
This was required inorder to support features such as Cancellation.
There is a side project that i have which allows to use task parallel library (for wp7 you need the async ctp sp1). You can find the project here https://github.com/prabirshrestha/Facebook.Extensions.Task
We are planning to integrate the Task Parallel Library features and the new c# 5 async and await feature into FacebookClient in the core Facebook.dll but will only happen once the async ctp has been RTMd.
If you really want to use the callback you can continue to use the FacebookApp class instead of FacebookClient. (FacebookApp is marked as obsolete and hidden from intellisense so you might not see it).
If you really want to use fql multiple times, It might be better to use it as a mutli-query instead.
fb.QueryAsync("query1","query2");
or you could even use batch requests. more information can be found at http://blog.prabir.me/post/Facebook-CSharp-SDK-Batch-Requests.aspx
精彩评论