コード例 #1
0
        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();
        }
コード例 #2
0
        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();
        }