/// <summary>
 /// Returns up to 100 of the first retweets of a given tweet.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="statusId">The status id.</param>
 /// <param name="options">The options.</param>
 /// <returns>
 /// A <see cref="TwitterStatusCollection"/> instance.
 /// </returns>
 public static TwitterResponse <TwitterStatusCollection> Retweets(OAuthTokens tokens, decimal statusId, RetweetsOptions options)
 {
     return(CommandPerformer.PerformAction(
                new Commands.RetweetsCommand(tokens, statusId, options)));
 }
 /// <summary>
 /// Returns up to 100 of the first retweets of a given tweet.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="statusId">The status id.</param>
 /// <param name="options">The options.</param>
 /// <param name="timeout">The timeout.</param>
 /// <param name="function">The function.</param>
 /// <returns></returns>
 public static IAsyncResult Retweets(OAuthTokens tokens, decimal statusId, RetweetsOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterStatusCollection>> function)
 {
     return AsyncUtility.ExecuteAsyncMethod(tokens, statusId, options, timeout, TwitterStatus.Retweets, function);
 }
Example #3
0
 /// <summary>
 /// Returns up to 100 of the first retweets of a given tweet.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="statusId">The status id.</param>
 /// <param name="options">The options.</param>
 /// <returns>
 /// A <see cref="TwitterStatusCollection"/> instance.
 /// </returns>
 public static TwitterResponse<TwitterStatusCollection> Retweets(OAuthTokens tokens, decimal statusId, RetweetsOptions options)
 {
     return CommandPerformer<TwitterStatusCollection>.PerformAction(
         new Commands.RetweetsCommand(tokens, statusId, options));
 }
Example #4
0
 /// <summary>
 /// Returns up to 100 of the first retweets of a given tweet.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="statusId">The status id.</param>
 /// <param name="options">The options.</param>
 /// <param name="timeout">The timeout.</param>
 /// <param name="function">The function.</param>
 /// <returns></returns>
 public static IAsyncResult Retweets(OAuthTokens tokens, decimal statusId, RetweetsOptions options, TimeSpan timeout, Action <TwitterAsyncResponse <TwitterStatusCollection> > function)
 {
     return(AsyncUtility.ExecuteAsyncMethod(tokens, statusId, options, timeout, TwitterStatus.Retweets, function));
 }
Example #5
0
 /// <summary>
 /// Returns up to 100 of the first retweets of a given tweet.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="statusId">The status id.</param>
 /// <param name="options">The options. Leave null for defaults.</param>
 /// <returns>
 /// A <see cref="TwitterStatusCollection"/> instance.
 /// </returns>
 public static async Task<TwitterResponse<TwitterStatusCollection>> RetweetsAsync(decimal statusId, OAuthTokens tokens, RetweetsOptions options = null)
 {
     return await Core.CommandPerformer.PerformAction(new Commands.RetweetsCommand(tokens, statusId, options));
 }
Example #6
0
 /// <summary>
 /// Returns up to 100 of the first retweets of a given tweet.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="statusId">The status id.</param>
 /// <param name="options">The options. Leave null for defaults.</param>
 /// <returns>
 /// A <see cref="TwitterStatusCollection"/> instance.
 /// </returns>
 public static async Task <TwitterResponse <TwitterStatusCollection> > RetweetsAsync(decimal statusId, OAuthTokens tokens, RetweetsOptions options = null)
 {
     return(await Core.CommandPerformer.PerformAction(new Commands.RetweetsCommand(tokens, statusId, options)));
 }
        /// <summary>
        /// Returns up to 100 of the first retweets of a given tweet.
        /// </summary>
        /// <param name="tokens">The tokens.</param>
        /// <param name="statusId">The status id.</param>
        /// <param name="options">The options.</param>
        /// <param name="timeout">The timeout.</param>
        /// <param name="function">The function.</param>
        /// <returns></returns>
        public static IAsyncResult Retweets(OAuthTokens tokens, decimal statusId, RetweetsOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterStatusCollection>> function)
        {
            Func<OAuthTokens, decimal, RetweetsOptions, TwitterResponse<TwitterStatusCollection>> methodToCall = TwitterStatus.Retweets;

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