/// <summary>
 /// Returns a collection of IDs for every user who has a pending request to follow the authenticating user.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="timeout">The timeout.</param>
 /// <param name="options">The options.</param>
 /// <param name="function">The function.</param>
 /// <returns></returns>
 public static IAsyncResult IncomingRequests(OAuthTokens tokens, IncomingFriendshipsOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterCursorPagedIdCollection>> function)
 {
     return AsyncUtility.ExecuteAsyncMethod(tokens, options, timeout, TwitterFriendship.IncomingRequests, function);
 }
 /// <summary>
 /// Returns a collection of IDs for every user who has a pending request to follow the authenticating user.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="options">The options.</param>
 /// <returns></returns>
 public static TwitterResponse<TwitterCursorPagedIdCollection> IncomingRequests(OAuthTokens tokens, IncomingFriendshipsOptions options)
 {
     Commands.IncomingFriendshipsCommand command = new Commands.IncomingFriendshipsCommand(tokens, options);
     return Core.CommandPerformer.PerformAction(command);
 }
 /// <summary>
 /// Returns a collection of IDs for every user who has a pending request to follow the authenticating user.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="options">The options.</param>
 /// <returns></returns>
 public static async Task<TwitterResponse<TwitterCursorPagedIdCollection>> IncomingRequestsAsync(OAuthTokens tokens, IncomingFriendshipsOptions options = null)
 {
     return await Core.CommandPerformer.PerformAction(new Commands.IncomingFriendshipsCommand(tokens, options));
 }
 /// <summary>
 /// Returns a collection of IDs for every user who has a pending request to follow the authenticating user.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="timeout">The timeout.</param>
 /// <param name="options">The options.</param>
 /// <param name="function">The function.</param>
 /// <returns></returns>
 public static IAsyncResult IncomingRequests(OAuthTokens tokens, IncomingFriendshipsOptions options, TimeSpan timeout, Action <TwitterAsyncResponse <TwitterCursorPagedIdCollection> > function)
 {
     return(AsyncUtility.ExecuteAsyncMethod(tokens, options, timeout, TwitterFriendship.IncomingRequests, function));
 }
Example #5
0
 /// <summary>
 /// Returns a collection of IDs for every user who has a pending request to follow the authenticating user.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="options">The options.</param>
 /// <returns></returns>
 public static TwitterResponse <TwitterCursorPagedIdCollection> IncomingRequests(OAuthTokens tokens, IncomingFriendshipsOptions options)
 {
     Commands.IncomingFriendshipsCommand command = new Commands.IncomingFriendshipsCommand(tokens, options);
     return(Core.CommandPerformer.PerformAction(command));
 }
 /// <summary>
 /// Returns a collection of IDs for every user who has a pending request to follow the authenticating user.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="options">The options.</param>
 /// <returns></returns>
 public static async Task <TwitterResponse <TwitterCursorPagedIdCollection> > IncomingRequestsAsync(OAuthTokens tokens, IncomingFriendshipsOptions options = null)
 {
     return(await Core.CommandPerformer.PerformAction(new Commands.IncomingFriendshipsCommand(tokens, options)));
 }
        /// <summary>
        /// Returns a collection of IDs for every user who has a pending request to follow the authenticating user.
        /// </summary>
        /// <param name="tokens">The tokens.</param>
        /// <param name="timeout">The timeout.</param>
        /// <param name="function">The function.</param>
        /// <returns></returns>
        public static IAsyncResult IncomingRequests(OAuthTokens tokens, IncomingFriendshipsOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterCursorPagedIdCollection>> function)
        {
            Func<OAuthTokens, IncomingFriendshipsOptions, TwitterResponse<TwitterCursorPagedIdCollection>> methodToCall = TwitterFriendship.IncomingRequests;

            return methodToCall.BeginInvoke(
                tokens,
                options,
                result =>
                {
                    result.AsyncWaitHandle.WaitOne(timeout);
                    try
                    {
                        function(methodToCall.EndInvoke(result).ToAsyncResponse());
                    }
                    catch (Exception ex)
                    {
                        function(new TwitterAsyncResponse<TwitterCursorPagedIdCollection>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
                    }
                },
                null);
        }