public static void AsyncTest2() { // Second example, uses a callback method IAsyncResult asyncResult = TwitterUserAsync.Show(null, "twitterapi", null, new TimeSpan(0, 0, 5, 0), ShowUserCompleted); // Block the current thread until the other threads are completed asyncResult.AsyncWaitHandle.WaitOne(); }
public static void AsyncTest() { // First example, uses lambda expression IAsyncResult asyncResult = TwitterUserAsync.Show( null, // tokens "twit_er_izer", // screen_name null, // optional parameters new TimeSpan(0, 0, 5, 0), // async timeout response => Console.WriteLine(response.ResponseObject.Status.Text)); asyncResult.AsyncWaitHandle.WaitOne(); }